Commit Graph

1563 Commits

Author SHA1 Message Date
Matt Bierner
848d300e8c Use explicit flag to enable TS server project wide intellisense (#171208) 2023-01-12 23:15:18 +01:00
Nathan Shively-Sanders
3261c7d3af Cross-file Typescript support in vscode-web (#169311)
* recreate logging from other machine

* comment out openSystemBrowser

Because I dont have the default browser set up correctnly on any of my
machiens

* Add vscode-wasm-typescript dep

And some logging as I figure out how to use it

* remove unused reference to module

* use require reference that linter allows

* Add vscode-wasm-typescript to tsserver.web.js

Use webpack's CopyPlugin transform pattern to do this manually. This is
probably a bad idea! It's just for prototyping purposes.

* Update vscode-wasm-typescript dependency

* Fix minor syntax in webpack hack

Nonetheless required for it to work!

* Fix another typo in webpack hack!

* Fix provided typescript path

Another typo. Guess my local test wasn't running the contents really

* Try to improve module.exports handling in webpack hac

* tsserver.web.js comes from local builds

Also:
- tsserver.js is no longer minified
- log crossOriginIsolated

* First attempt to set up server-side support

* Remove auto-imported identifier

* Move sync-api setup code to serverProcess.browser.ts

Because it's browser-specific

* Reorder webpack hack and clean up unused logging

* Update vscode-wasm/vscode-wasm-typescript dependencies

* Add file watching

* Extract webpack hack

Build only the ts parts of tsserver.web.js, don't rebuild the vscode
extension. This is a lot faster.

* Remove manual verbose logging

Sheetal showed me the correct way to create a verbose logger instead.

* Add vscode-test-web to semantic-supported schemes

And make isWeb support semantic mode.

* Also update the webpack-hack-only build

* Switch to tsserverlibrary

Also paste in some example code for cancellation, which is not finished
at all.

* Remove bogus auto-import and unneeded (?) dep

* remove webpack-like hack

* move code from vscode-wasm-typescript

* Initial prototype of cancellation

It compiles and looks kind of plausible. But I haven't tested it yet.

* Switch tsserver to separate MessageChannel

* Move watches to a separate MessagePort

Further simplifies the message dispatch code by shifting complexity to
setup. And the setup is straight-line code.

* switch vscode-web from in-memory to real filesystem

goto-def is currently broken because some part of main vscode still
needs treat the files as in-memory, though.

* Make toResource translate / -> vscode-test-web

* Encode scheme and authority in TS filenames

Like the previous host did, but without the leading ^ that TS hard-codes
as "in-memory".

The tsserver host needs to know about the encoding, but the translation
is in a single function. This also means that displayed file paths are
prefixed with /scheme/authority (/vscode-test-web/mount in my testing), but I think that's fine.

* Lift parseUri outside createServerHost

I'm not using it to set the schema/authority for getCurrentDirectory
right now, so there's no shared state to mutate.

* Special-case URI of lib*d.ts in webServer.toResource

Similar to the special-casing in typescriptServiceClient.toResource.
Also requires passing in the extensionUri. This feels like it's breaking
through at least one abstraction layer, which might be a problem.

* Improve cancellation

1. Simplify cancellation checking in web tsserver host to match the
checking in typescript's node host.
2. Move cancellation of request in the extension to tryCancelRequest
from sendNextRequests.
3. Only send cancellation via node or web cancellation, not both.

* Pass in current request instead of waiting for a fresh one.

* Address initial PR comments

Also add some TODO comments for the revision to watches.

* Add cancellation bit to each (cancellable) request, locally fix an issue with retrieving the cancellation bit

* Switch to per-file/directory watches

Watching the entire filesystem recursively is supposed to be
inefficient.

Not done yet: there is an error when watching directories, but it works.
And I can't tell whether watching files works yet.

* Parse --serverMode partialSemantic in webServer

Now the syntax server actually runs as a syntax server.

* Simplify logging code

* Cleanup in webServer

1. Remove a little logging.
2. Correct failure return value for getFileSize
3. Reorder some methods and parameters.

* Switch to markdown extension's FileWatcherManager

I'm not sure if it's OK to depend on a module from another extension;
it's probably better to include the files from a central place instead.

* Clean up host methods

1. Copy and adapt implementations from node host where possible.
2. Note questions for the PR elsewhere.
3. Remove logging except for caught exceptions.

* More logging/TODO cleanup

* Remove duplicate dependency

* Add setting to enable/disable semantic mode on web

Also gate it behind a check to `crossOriginIsolated`

* Re-order and re-arrange code to minimise PR diff

It won't minimise it *much*, but I also consolidated some
unnecessarily-spread-out code that will be easier to read in the long
term, and possibly easier to read in diff form as well.

* Copy fileWatchingManager to typescript extension

Copy from markdown extension to typescript extension. I used the
existing dependencies in the typescript extension, but verified that
they would work the same.

* Fix linting of webServer

* Align formatting of catch / else

* Extract isProjectWideIntellisenseOnWebEnabled and keep using in-memory prefix when project wide intellisense is disabled

* Make sure we still work if SharedArrayBuffers aren't supported

* Remove symlink support and fix typo

Symlinks are implicitly supported by the filesystem right now.

* Fix compile errors

Co-authored-by: Johannes <johannes.rieken@gmail.com>
Co-authored-by: Matt Bierner <matb@microsoft.com>
2023-01-12 11:54:39 -08:00
Matt Bierner
e14165e0f5 Remove extra space in log message (#171197) 2023-01-12 20:43:08 +01:00
Matt Bierner
95f9599d16 Remove typescript.suggest.includeCompletionsWithSnippetText setting (#171098)
Fixes #171091

This setting controls TS Server's behavior and should not be exposed directly. Instead you can use the `includeCompletionsForImportStatements` and  `suggest.classMemberSnippets.enabled` settings to enable/disable individual types of completions
2023-01-11 12:09:32 -08:00
Logan Ramos
4acf2d9b46 Update the telemetry modules (#170512)
Update the module
2023-01-03 15:10:45 -05:00
Logan Ramos
b1076b41f3 Bump telemetry packages (#169283) 2022-12-15 17:29:10 +01:00
Matt Bierner
b63dd77718 Remove TS extension's use of resolver proposal (#168371)
Fixes #164039
2022-12-08 01:16:19 +01:00
Matt Bierner
1c89f079be Don't show empty @return in JSDoc (#168366)
Fixes #164888
2022-12-07 15:47:31 -08:00
Tyler James Leonhardt
eab8c54b30 Fix a translation (#168353) 2022-12-08 00:08:36 +01:00
Matt Bierner
fd0ee4f77e Remove explicit support for TS versions < 3.0 (#168348)
This removes extra code we had to support TS versions that are 4+ years old. We do not test these versions and a very small number of users are actually using them
2022-12-07 23:31:35 +01:00
Matt Bierner
16e7698751 Shorten update import labels (#168250)
Fixes #165907

This aligns with the markdown update imports UI
2022-12-07 01:09:05 +01:00
Matt Bierner
3e7637064d Use more generic button title for jsconfig create/open (#167482)
For #166808
2022-11-29 00:39:56 +00:00
Matt Bierner
838b48504c Pick up TS 4.9 final (#166509) 2022-11-16 14:16:36 -08:00
Greg Van Liew
816f31f691 More settings description tuning (#166429) 2022-11-16 09:33:33 -08:00
Matt Bierner
5452c6af10 Eagerly delete diagnostic on quick fix (#166417)
Fixes #166415
2022-11-16 07:43:28 +01:00
Matt Bierner
7d6c575031 Check cancellation token earlier and avoid capturing resolve (#166416) 2022-11-15 16:33:01 -08:00
Matt Bierner
d0d28a6295 Reapply building of web server (#166391)
* Reapply building of web server

Revert 8b4642ab23

* Fix critical dep error
2022-11-15 14:55:40 -08:00
Matt Bierner
4fdcdb17c6 Pick up latest jsonc parser (#166334) 2022-11-15 13:46:52 -08:00
Henning Dieterichs
b11207c539 Revert "Copy webServer from Typescript to VS Code (#165771)"
This reverts commit cb43019d6a.
2022-11-15 14:45:32 +01:00
Matt Bierner
44441de137 Adopt prefer-readonly in JS/TS extension (#165089) 2022-11-14 20:12:10 -08:00
Greg Van Liew
27a550f451 Settings description edits (#166315)
* Settings description edits

* Remove unnecessary trailing line returns
2022-11-14 13:47:54 -08:00
Nathan Shively-Sanders
cb43019d6a Copy webServer from Typescript to VS Code (#165771)
* Initial draft.

Not working.
Also not correctly formatted, I'll do that later.

* Various fixes

It works now

* A bit of cleanup

* Move webServer to its own directory

And prepare for getting rid of dynamicImportCompat.js hack

* Remove dynamicImportCompat.js hack

* Revert unrelated change

* Webpac tsserver.web.js with webServer.ts as entrypoint

Instead of using CopyPlugin.

1. Shipping multiple entrypoints in a single file required fixes to
build code.
2. There are a couple of warnings from `require` calls in
tsserverlibrary.js. Those are not relevant since they're in non-web
code, but I haven't figured how to turn them off; they are fully dynamic
so `externals` didn't work.

* Ignore warnings from dynamic import in tsserver

* Add to .vscodeignore files
2022-11-14 10:56:31 -08:00
Logan Ramos
73d882bcf7 Update telemetry package (#166292) 2022-11-14 09:30:33 -08:00
Logan Ramos
bf1697d98c Consume proposed telemetry API (#165862)
* Consume proposed telemetry API

* Update webpack
2022-11-08 21:58:28 -05:00
Matt Bierner
5d04c3b06c Don't assume file paths in tsconfigs (#165779)
Fixes #160979
2022-11-07 20:24:31 -08:00
Matt Bierner
3c874be287 Fix UI string (#165554) 2022-11-04 14:04:58 -07:00
Matt Bierner
0bd1531e00 Adopt l10n for ts extension (#165450)
For #164438

Also refines the eslint rule from #165448
2022-11-04 09:50:18 +01:00
Matt Bierner
8ad43669a9 Prompt users to test with extensions disabled (#165203) 2022-11-01 16:38:45 -07:00
Jake Bailey
b99cf7e41e Ensure 'undefined' does not make it into tsserver.web.js (#164064) 2022-10-19 16:44:03 -07:00
Daniel Rosenwasser
182beb6ee4 Merge pull request #163498 from DanielRosenwasser/iconsForWalkthroughs
Allow walkthroughs to specify icons.
2022-10-19 11:26:51 -07:00
Matt Bierner
7f99b7c655 Remove references to finalized proposals in js/ts (#164040) 2022-10-19 13:23:48 -04:00
Matt Bierner
33378c2ec0 Fix organize imports (#164035)
Fixes #163994

This fixes the organize imports command (it was using the wrong id) and also cleans up the implementation
2022-10-19 09:27:41 -07:00
Andrew Branch
1fb956d2f5 [typescript-language-features] Add removeUnusedImports command (#161654)
* Add `removeUnusedImports` command

* Continue to send `skipDestructiveCodeActions` for older TS versions

* Expose Sort Imports and Remove Unused Imports commands

* Update localization keys

* Update for 4.9 protocol

* Proto must be type only import?
2022-10-18 09:00:16 -07:00
Matt Bierner
186d3415a3 Use ??= in more places (#163594) 2022-10-13 14:59:35 -07:00
Jake Bailey
65a9097aa2 Remove forgoten reference to typescript/lib/protocol (#163585) 2022-10-13 13:15:13 -07:00
Daniel Rosenwasser
a053a4d505 Allow walkthroughs to specify icons.
Useful for specifying icons *other* than those of the contributing extension.
2022-10-12 17:14:42 -07:00
Jake Bailey
07b87405e7 Don't depend on typescript protocol.d.ts (#163365) 2022-10-12 16:03:07 -07:00
Suven-p
22ff985c19 Add multiple template parameters (#163191) 2022-10-12 14:06:19 -07:00
Tyler James Leonhardt
4322170fd8 comment is an array (#163348) 2022-10-11 13:39:12 -07:00
Matt Bierner
3ee9749b35 Remove extra enums (#162686)
`showMessage` returns the selected item, so we don't need to create an enum here and can instead used the returned items directly
2022-10-04 10:46:53 -07:00
Tyler James Leonhardt
29e985eca0 rev vscode-nls to version that doesn't ask for vscode-nls-web-data (#161819)
ref #161297
2022-09-26 11:10:54 -07:00
Gerrit Birkeland
cace09d0eb Add schema for typedoc.json to default jsonValidation (#157592)
Add schema for typedoc.json to default 
jsonValidation
2022-09-26 15:51:42 +02:00
Daniel Rosenwasser
da506e9b8d Tag existing events with experimentation info in typescript-language-features (#161463)
* Associate experiment info with existing telemetry.

* Move the ExperimentTelemetryReporter to its own file.

* Roughly copied the 'getPackageInfo' function from other extensions.

* Addressed code review feedback.
2022-09-23 15:18:57 -07:00
Matt Bierner
f25d47121b Pick up newer vscode-tas-client version (#161344) 2022-09-20 13:52:29 -07:00
Daniel Rosenwasser
5cde74b767 Fix accidental case fallthroughs in experimentation services. (#161339) 2022-09-20 12:00:32 -07:00
Johannes Rieken
77309b33d4 add WorkspaceEditMetadata and use it for applyEdit, (#160996)
* add `WorkspaceEditMetadata` and use it for `applyEdit`,

https://github.com/microsoft/vscode/issues/112109

* fix compilo in tests

* workspace edits from updating paths are marked as refactoring fyi @mjbvz
2022-09-16 09:44:19 +02:00
Matt Bierner
3c37a5a8d7 Reapply JavaScript and Node.js walkthrough (#161003)
This reverts commit cfc0119755.

Brings the walkthrough back in but makes sure it is only loaded on desktop
2022-09-15 13:02:43 -07:00
Daniel Rosenwasser
9dfd49db63 Ensure ExperimentationService gets disposed. (#161004) 2022-09-15 11:06:53 -07:00
Benjamin Pasero
cfc0119755 Revert "JavaScript and Node.js walkthrough" (#160959)
Revert "JavaScript and Node.js walkthrough (#157965)"

This reverts commit 0cbcb1b1ab.
2022-09-15 08:26:22 +02:00
Daniel Rosenwasser
0cbcb1b1ab JavaScript and Node.js walkthrough (#157965)
* Initial contents for JavaScript walkthrough.

* Just suggest a `.js` file.

* Switch the walkthrough to be a Node.js walkthrough.

* Remove leftover file from HTML walkthrough.

* Add basic detection mechanism for node.

* Don't check for a Node install until the user runs debug.

* Add "learn more" link.

* Some assets.

* Remove "run" section.

* Add a "try debugging anyway" option just in case.

* Remove "view terminal" command in run & debug.

* More copy.

* Remove unused command.

* Update icon and themed walkthrough SVGs

* Default to not showing the extension.

* Replace icon

* Delete TODO.md

* jsWelcome -> nodejsWelcome

Co-authored-by: David Dossett <ddossett@microsoft.com>
Co-authored-by: Matt Bierner <matb@microsoft.com>
2022-09-14 09:53:37 -07:00