Commit Graph

1609 Commits

Author SHA1 Message Date
Matt Bierner
6f5920818a Bump eslint versions (#178516) 2023-03-28 14:16:09 -07:00
Matt Bierner
07b2b6066b Remove extra file check in documentHighlights (#177879)
Fixes #177823

For document hightlights, it seems TS returns windows paths that use forward slashes. This seems wrong, but we also likely don't need the extra check for the file on our side either since we already pass in `filesToSearch`
2023-03-21 21:09:19 +01:00
Matt Bierner
26e7b9a3bd TS source actions should not be blocked by pending action requests (#177737)
Fixes #164876
2023-03-21 10:29:56 -07:00
João Moreno
c6fbb48ec4 Revert "Update webpack (#177265)"
This reverts commit e88eb65966.
2023-03-17 18:55:15 +01:00
Martin Aeschlimann
e88eb65966 Update webpack (#177265)
* update webpack

* update `@types/webpack`

* update copy-webpack-plugin

* update @types/webpack in build

* fix compile error in @types/eslint
2023-03-17 15:07:05 +01:00
Matt Bierner
549d31a5d5 Stop VS Code from transforming uris in tsconfig document link (#177305)
Fixes #160979
2023-03-15 17:17:18 -07:00
Matt Bierner
54921d7173 Pass TS Server the original fs path (#177292)
For #177083

We've had code to normalize the file path for a long time but I don't think it's needed. In the case of samba paths, it also appears to break things

Let's try dropping it and passing along the original `fsPath` instead
2023-03-15 15:00:15 -07:00
Fabio Spampinato
2a20cc59f0 Updated title for typescript.restartTsServer command (#177167) 2023-03-15 16:14:31 +00:00
Matt Bierner
3df6a29a80 Don't skip JS/TS diagnostic updates on equals (#177149)
Even though the diagnostics on the ext host side may be equal, the displayed diagnostic may be at a different spot. We need to make sure the UI is also updated in these cases by setting the diagnostics again
2023-03-14 18:03:51 -07:00
Matt Bierner
1f3da727a9 Bump TS web version (#176577) 2023-03-09 07:32:42 -08:00
Matt Bierner
ed43d97e47 Always use TS's sort text in TS 5+ (#176322)
* Always use TS's sort text in TS 5+

Fixes #174628

* Add missing file
2023-03-06 17:12:44 -08:00
Matt Bierner
797291f90f Fixing some project wide intellisense issues in safari (#176294)
For #175229

- Safari can't transfer `Proxy` objects
- Safari's nested worker polyfill wasn't forwarding along the `ports` field on message events
2023-03-06 12:52:34 -08:00
Matt Bierner
1270982c75 Make add missing new auto fixable (#175720)
Fixes #175719
2023-03-01 06:50:11 +01:00
Matt Bierner
28d9a83f12 Fix TS Server logging on windows (#175600)
Fixes #175172

We need to pass TS the windows style path here
2023-02-28 14:36:27 -07:00
Matt Bierner
ce24cb7dac Fix suggest action toggling (#175567)
Fixes #175113
2023-02-27 20:10:00 +01:00
Matt Bierner
4d247bae44 Don't allow one click reporting of TS Server crashes against VS Code repo when TS server plugins are enabled (#175186)
Don't allow one click reporting of TS Server crashes when TS server plugins are enabled

Fixes #175184
2023-02-22 23:26:18 +00:00
Matt Bierner
5170e1a42b Use native path for trace directory (#173856)
Fixes #173854

On windows, we need to pass in the `c:\` style path. The normal `/` path causes TS Server to crash
2023-02-08 10:41:10 -08:00
Matt Bierner
095a2f8ae8 Log correct tsserver path (#173708)
Fixes #173707

We previously converted the TS Server log from a simple string to an object. However there were a few cases where this object was incorrectly being converted into a UI string, resulting in `[Object object]`
2023-02-07 09:18:15 -08:00
Matt Bierner
25514d899f Use pervious crashed TS Server version to check if user was on old TS version (#173620)
Use pervious crashed version to check if user was on old TS version

Fixes #133818
2023-02-06 15:05:19 -08:00
Matt Bierner
d948f68bd1 Skip watching lib files on web (#173601)
These files can never change on web so there is no point in creating a watcher for them
2023-02-06 14:01:53 -07:00
Logan Ramos
8e6bcc9b9e Bump module to new package (#173599) 2023-02-06 12:29:36 -08:00
Matt Bierner
eec5c907ea Fix web TS Server trying to read files outside of project root (#173591)
There's a bug on the TS Server side that causes it to traverse out of the project root when checking for directories like `node_modules`. On web this ends up being super slow because it goes to the network

This fix blocks those reads
2023-02-06 11:17:21 -08:00
Matt Bierner
69b6f978f6 Make sure we pass TS server the transformed project root (#173096)
When opening a file, we pass TS Server a project root to prevent it from scanning too many files. On web, we need to pass the transformed project root, not the original uri

This PR also removes some confusingly duplicated methods and renames them to make their behavior more clear
2023-02-02 11:30:04 +00:00
Matt Bierner
6c12ba1f81 Revert to TS 4.9.5 for this iteration (#173081)
TS 5.0 doesn't come out til mid March
2023-02-01 15:12:13 -08:00
Matt Bierner
224472b8b9 Pick up latest TS nightly (#172928)
This lets us remove the `ignoreWarnings` webpack hack
2023-01-31 16:37:29 -08:00
Matt Bierner
855dd78852 Fix open ts server log command on web (#172885)
Fixes #172853
2023-01-31 06:34:00 +01:00
Matt Bierner
4630d8e4de Remove more implicit activation events from built-in extensions (#172838) 2023-01-30 17:25:56 -08:00
Matt Bierner
5be17a3f51 Use uris instead of string paths for TS Server logs (#172872) 2023-01-30 16:28:53 -08:00
Matt Bierner
e0ea3d9b11 Also route stdlib files through TS Server virtual file system (#172857)
This workaround doesn't seem to be needed any more
2023-01-30 14:14:21 -08:00
Matt Bierner
99d9949a7c Make remove await quick fix auto fixable (#172854)
Make remove `await` quick fixable

Fixes #172851
2023-01-30 14:09:30 -08:00
Matt Bierner
35b008315a Fix web compile for TS 5.0 (#172856)
This fixes the error message in `ignoreWarnings` for TS 5.0
2023-01-30 14:09:08 -08:00
Matt Bierner
f3edd0e0be Fix TS Server always logging (#172562)
Fixes #172554
2023-01-30 09:39:19 -08:00
Matt Bierner
b1a4dfdcfd TS should ignore github: files (#172603)
Fixes #172597
2023-01-30 08:39:43 -08:00
Johannes Rieken
46a157973f fix TS filterText/insertText updating (#172616)
fixes https://github.com/microsoft/vscode/issues/172419
2023-01-27 10:06:14 +01:00
Matt Bierner
869f00e0c6 Restore slice call for decoding file contents (#172438)
We need to slice the bytes since we can't pass a shared array to text decoder
2023-01-25 20:59:20 +01:00
Matt Bierner
d749617c78 Add more verbose logging to TS Server web calls (#172325) 2023-01-25 02:30:33 +01:00
Matt Bierner
6c710f3324 Give debug name to the TS Server workers (#172328)
Give a debug name to the TS Server workers

This gives the TS Server worker process debug name, which helps with debugging and profiling
2023-01-24 17:07:33 -08:00
Matt Bierner
983ee9c0f9 Make sure only lib files go through XMLHttpRequest in TS Server (#172327)
If project wide IntelliSense is enabled, we want to make sure only `lib` files do through the old `XMLHttpRequest` flow
2023-01-24 17:05:19 -08:00
Matt Bierner
1ec468f1d6 Small fixes to web server (#172295)
- Fix loading of `/lib.dom.d.ts` files
- Remove file content copies being made on read
- Extract encoder/decoder constants
- Small formatting cleanup
- Remove platform setting since it's not relevant
2023-01-24 15:26:27 -08:00
Matt Bierner
3e4a338c7a Fix compile errors in webserver (#172083)
- Remove deprecated flag
- Use more explicit typings
2023-01-24 00:39:58 +01:00
Matt Bierner
f6318f31f7 Try downloading repo for project wide IntelliSense (#171686)
* Try downloading repo for project wide IntelliSense

For #170920

* Defer preload
2023-01-23 16:30:56 -05:00
Vitaly
b9ee0575f1 [typescript] fix potential [object Object] in member completions (#171127) 2023-01-23 19:35:37 +00:00
Logan Ramos
8cea434dec Remove unused proposals (#172035) 2023-01-23 19:09:07 +01:00
Matt Bierner
7545b2f6d0 Use single TS server output log channel on web (#171679)
Previously we were creating a new output channel for each server instance
2023-01-18 14:32:53 -08:00
Matt Bierner
9f48317464 Enable JS/TS project wide intellisense for opened folders on web (#171678)
For #170920
2023-01-18 23:25:11 +01:00
Jake Bailey
43907341df Set disableLineTextInReferences=true in TS user preferences (#171376) 2023-01-17 16:46:36 +00:00
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