Commit graph

1792 commits

Author SHA1 Message Date
Aiday Marlen Kyzy 0d4db5ffc4
sending the diagnostics on handle exit 2023-08-17 14:35:27 +02:00
Aiday Marlen Kyzy 614bfb3d33
sending diagnostics on file open 2023-08-17 14:07:03 +02:00
Aiday Marlen Kyzy b4801aeb02
adding the data relative to the diagnostic error codes in the typescript extension 2023-08-15 12:20:02 +02:00
Nathan Shively-Sanders a288cbbdaf Merge branch 'main' into ai-inferFromUsage 2023-08-14 16:41:26 -07:00
Nathan Shively-Sanders 44375f76ca Offer infer-types quickfix separate from Typescript one 2023-08-14 10:48:18 -07:00
Vitaly 432aac18f1
[typescript] Better paths matching for move to existing file quickpick (#181231)
* Better paths matching for move to existing file quickpick

* fix resolving selected item

* fix: select file dialog point to existing file

* skip computing if
use coalesce

* Improve typings

---------

Co-authored-by: Matt Bierner <matb@microsoft.com>
2023-08-09 21:29:30 +01:00
Matt Bierner 4f66a0c2c1
Updating bundled and build TS versions (#189868) 2023-08-07 17:04:12 -07:00
Robo ea490e5545
chore: update to Electron 25 (#188268)
* chore: update electron@25.3.0

* ci: update NodeTool version

* chore: update @types/node

* add more common types to layers checker

* chore: update debian dependencies

* chore: update rpm dependencies

* fix: use legacy dns result order of Node.js

* ci: remove deprecated always-auth npm config

Refs npm/cli@72a7eeb

* chore: update deb and rpm dependencies

* chore: update armhf rpm dependencies

* chore: update x64 debian dependencies

* chore: update x64 rpm dependencies

* chore: update electron@25.3.1

* chore: update electron@25.4.0

* chore: bump distro

* chore: bump distro

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
2023-08-07 21:46:27 +09:00
Matt Bierner 3cc82327b5
Bump TS versions (#189344)
Bumps TS version for building VS Code
Bumps bundled TS version
2023-07-31 20:13:11 +01:00
Alexandru Dima f94dcb9ae0
Turn off aiQuickFix by default for stable (#189069) 2023-07-27 17:16:25 +01:00
Matt Bierner e2720e7bf4
Make getWorkspaceRootForResource work for notebook cells (#188186)
Fixes #186811
2023-07-19 05:29:22 +10:00
Matt Bierner 40abe0e1d5
Explicitly add link in JSDoc (#188182)
Fixes #188159
2023-07-18 11:15:14 -07:00
Andrew Branch 6c94c8e088
[typescript-language-features] Update autoImportFileExcludePatterns description (#186528)
Update autoImportFileExcludePatterns description
2023-07-14 18:36:38 +00:00
Matt Bierner c0d560ed49
Don't parse @link inside @example JSDoc tags (#187877)
Fixes #187768
2023-07-13 16:02:57 -07:00
Matt Bierner a4fde6f2eb
Add more specific error for TS web server (#187752)
This should help us better understand why the access failed
2023-07-12 14:09:01 -07:00
Raymond Zhao 5be539a588
Bump semver (#187654) 2023-07-12 01:49:45 +02:00
Matt Bierner 00105d2ddb
Exclude azurerepos: files from JS/TS intellisense (#187521)
Fixes #186385
2023-07-11 08:45:12 -07:00
dependabot[bot] 8c8e8600b6
Bump semver from 5.5.1 to 7.5.2 in /extensions/typescript-language-features (#185968)
Bump semver in /extensions/typescript-language-features

Bumps [semver](https://github.com/npm/node-semver) from 5.5.1 to 7.5.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.5.1...v7.5.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 10:05:01 +02:00
Nathan Shively-Sanders 5e72826c4c AI quickFix noImplicitAny: replaces inferFromUsage 2023-07-06 13:11:17 -07:00
Matt Bierner 688bc028e3
Extends tsconfig link logic to references paths (#186227)
Fixes #182898
2023-06-26 14:55:10 -07:00
Johannes Rieken 50ad64e844
enable inline chat quick fix for TypeScript implements interface by default (#186167) 2023-06-26 17:34:39 +02:00
Matt Bierner 5ee455116f
Add codeql comments and small fix (#185931) 2023-06-23 02:40:39 +02:00
Matt Bierner 3a02b99fe8
Try to request workspace content caching on commit (#185920)
For #175972

Here's what believe is happening:

- Workspace opens. We download the archive for the current commit
- User makes a commit
- The commit has now changed, which invalidates the archive. However TS doesn't know this (all the uris seem to stay the same). This means that we silently start going to the network again on file system operations

To fix this, we're going to try re-requesting the archive when a file system change event is fired for the workspace root. This should happen when a commit is made
2023-06-22 15:33:06 -07:00
Matt Bierner 538da53226
Dispose of file watchers when web TS server exits (#185815)
Dispose of file watchers when TS server exits
2023-06-21 17:14:21 -07:00
Matt Bierner e30b2359c5
Add logging for TS extension file watcher creation (#185813)
Add logging for extension file watcher creation
2023-06-21 15:36:39 -07:00
Matt Bierner 1eabca5501
Support downloading repo contents for all github authorities (#185707)
For #175972

Previously this was broken for `github%2b...` style authorities
2023-06-20 15:19:11 -07:00
Matt Bierner 7f8893b149
Add more logging for when loadWorkspaceContents isn't used (#185624) 2023-06-19 17:42:38 -07:00
Matt Bierner ab8ed4b717
Fallback to use insert text when label is falsy (#184944)
For #184812
2023-06-12 21:11:42 +02:00
Matt Bierner 977ee8ca1e
Add logging of readDirectory (#184549) 2023-06-07 15:22:16 -07:00
Matt Bierner 42498ee647
Mention tsconfig / jsconfig in 'Go to project configuration' (#184441)
This makes the commands more discoverable
2023-06-06 13:41:54 -07:00
Matt Bierner af4c133f63
Pick up TS 5.1.3 (#184091)
Fixes #182931
2023-06-01 21:07:19 +02:00
Matt Bierner 14977db0ec
Disable move to file in TS versions < 5.2 (#183992)
There are still a few key bugs with refactoring. We will  ship this as a preview for TS 5.2+ instead of for 5.1
2023-05-31 22:18:24 +02:00
Matt Bierner 2add9d4c10
Set isRefactoring for all TS refactoring edits (#183982) 2023-05-31 19:14:35 +02:00
Matt Bierner f4175f4a13
Default to current dir for move to file select (#183875)
Fixes #183870

`showOpenDialog` seems to ignore `defaultUri` if the file doesn't exist
2023-05-31 09:58:03 +10:00
Matt Bierner d1ae1fff18
Make JS/TS go to configuration commands work on non-file: file systems (#183688)
Make `go to project` commands work on non-`file:` file systems

Fixes #183685
2023-05-30 16:07:14 -07:00
Matt Bierner 8a71f8515d
Noop when moving a symbol into the file it is already in (#183866)
Fixes #183793
2023-05-30 13:40:45 -07:00
Matt Bierner ea7d830fb4
Fix some errors for project wide JS/TS IntelliSense (#183482)
- Don't compute `semanticSupportedSchemes` early, as this may be incorrect if the script is loaded before there are workspace folders

- Handle exceptions when watching files by logging them but not crashing the server
2023-05-25 18:43:46 -07:00
Matt Bierner 710d6ea32c
Fix new path suggestion for move to file (#183474)
Turns our `newFileName` is actually a path :)
2023-05-26 00:29:58 +02:00
Aiday Marlen Kyzy 81f98eb8fe
adding text to better explain the dependence on the AI extension 2023-05-25 15:20:55 +02:00
Aiday Marlen Kyzy 0cce0c2f51
adding typescript in front 2023-05-25 14:48:50 +02:00
Aiday Marlen Kyzy 454a8e61ff
polishing the code 2023-05-25 14:46:57 +02:00
Matt Bierner 0908552502
Pick up latest TS for building VS Code (#183358) 2023-05-24 23:19:24 +02:00
Aiday Marlen Kyzy 203c911ca0
adding a setting in order to control whether the ai assisted setting is enabled or not 2023-05-24 16:18:04 +02:00
Johannes 2b8529fa61
make API command for interactiveEditor.start so that initial range can be set properly 2023-05-24 15:21:18 +02:00
Johannes ce7986f35e
extract logic into EditorChatFollowUp class 2023-05-24 15:02:56 +02:00
Aiday Marlen Kyzy 49043016b5
cleaning the code 2023-05-24 10:51:07 +02:00
Aiday Marlen Kyzy b07e68e5fb
cleaning the code 2023-05-23 18:35:36 +02:00
Aiday Marlen Kyzy 1a50d63321
added the arrow function into the private function 2023-05-23 18:18:44 +02:00
Aiday Marlen Kyzy b278ac8a54
resetting the privacy modifiers 2023-05-23 17:29:40 +02:00
Aiday Marlen Kyzy b2361a5c83
removing some console logs 2023-05-23 17:28:46 +02:00
Aiday Marlen Kyzy e5a37e8d5f
setting the right end line number 2023-05-23 17:26:33 +02:00
Aiday Marlen Kyzy c7b6e732e7
initial code 2023-05-23 16:17:41 +02:00
Aiday Marlen Kyzy 90a6ac4a63
adding a console log 2023-05-23 15:25:53 +02:00
Bhavya U b0cf9f8e24
Remove temp walkthroughs (#182996) 2023-05-19 15:28:27 -07:00
Matt Bierner 65123b465a
Allow clickable links to absolute tsconfig extends paths (#182921)
Fixes #182898
2023-05-19 01:05:34 +02:00
Matt Bierner 728197deb8
Remove some completions logic specific to old TS versions (#182894)
Removes workarounds added for TS versions that are many years old at this point
2023-05-18 11:10:31 -07:00
Gabriela Araujo Britto 8457aa24b2
[typescript-language-features] Use original filterText if present (#172866)
* use original filter text, if present

* update comment
2023-05-17 22:37:11 +00:00
Matt Bierner 4d59b19b73
Enable project wide JS/TS intellisense on web by default (#182812)
Fixes #170920

Enables this feature by default but also disables semantic errors. This is needed to avoid lots of annoying false positive errors for external modules. We plan to remove this limitation once type downloading support is enabled
2023-05-18 00:06:00 +02:00
Matt Bierner adddf406d0
Simplify buffer enums (#182811) 2023-05-18 00:01:06 +02:00
Matt Bierner 1569f9d9d7
Don't cancel file reopen if language has changed (#182657)
Fixes #182526

The chat panel changes the language of a document. This revealed a bug in JS/TS about language changes.

Normally changing a language should close and reopen a text document. However we added an optimization to not do this full flow if the open then close happens quickly

However this causes issues if the file changes languages as TS gets into a state where its doc language id does not match VS Code's language id. To fix this, I've limited the optimization to only apply when the expected script kinds match
2023-05-16 12:28:14 -07:00
Matt Bierner 8b11c814cc
Use better placeholder for move to file (#182108) 2023-05-10 12:56:25 -07:00
Bhavya U 6efb31c7a9
Add temporary nodeJS walkthrough (#181441) 2023-05-03 12:31:11 -07:00
Matt Bierner be03603bfe
Remove duplicated types (#181267) 2023-05-01 19:15:34 +00:00
Matt Bierner 8243eb2556
Fix enumItem labels (#180889)
`javascript.preferences.importModuleSpecifierEnding` and `typescript.preferences.importModuleSpecifierEnding` got out of sync here
2023-04-25 16:14:03 -07:00
Matt Bierner 42fbc2f784
Use custom command to open JS doc links (#180737)
Fixes #162507

Prevents incorrect auto transform of the uri
2023-04-24 15:05:14 -07:00
Matt Bierner 03540d605f
Pick up latest TS for building VS code (#180706) 2023-04-24 20:14:30 +02:00
Matt Bierner 6a9c24cbd0
Update importModuleSpecifierEnding to mention .ts (#180349)
Makes the `importModuleSpecifierEnding` settings mention that it can include `.js` or `.ts`
2023-04-19 20:43:53 +02:00
Matt Bierner 6fefe056e2
Don't show JS/TS loading indicator eagerly (#180265)
This fixes the loading indicator showing when an extension opens an in-memory JS file that doesn't belong to any project
2023-04-18 19:14:49 -07:00
Matt Bierner f24d50369f
Add note on required TS version to setting (#180271) 2023-04-18 19:14:17 -07:00
Donald33 Wang 7122771026
Support custom switch-case indentation (#179670) 2023-04-18 17:24:51 +00:00
Matt Bierner 95396f14db
Don't complete jsx tag as function call (#180171)
Fixes #177606
2023-04-17 21:12:28 -07:00
Matt Bierner 24c44070ae
Revert "Nicely format logged objects (#179405)" (#179894)
This reverts commit 5d3f960b67.

Based on comments in https://github.com/microsoft/vscode/pull/179405#issuecomment-1506843399
2023-04-13 18:55:06 +01:00
Matt Bierner 26ccce443f
Enable renaming of matching jsx tags (#179806)
Fixes #159534

Uses the new linked editing api to make f2 rename matching jsx tags
2023-04-12 21:42:59 +02:00
Matt Bierner 5d3f960b67
Nicely format logged objects (#179405)
Follow up oin https://github.com/microsoft/vscode/issues/176479#issuecomment-1498597499

This uses JSON.stringify to format objects that are logged. Currently they are all printed as a single line without any whitespace
2023-04-11 13:04:44 -07:00
Matt Bierner a58d9dc08f
Update linked editing file name (#179643)
Also make sure we are enabled in all syntax files
2023-04-10 15:55:44 -07:00
Matt Bierner 06659f0ba9
Add stubs for jsx linked editing (#176279)
* Add stubs jsx linked editing

For https://github.com/microsoft/TypeScript/issues/51832

* Update for new TS changes

* Update to finalized protocol
2023-04-10 23:32:09 +01:00
Andrew Branch 117668153b
[typescript-language-features] Support replacing Go to Definition with Go to Source Definition by preference (#178840)
* Add preference for replacing Go to Definition with Go to Source Definition

* Support replacing Go to Definition with Go to Source Definition by preference

* Predicate call on TS version
2023-04-05 21:17:01 +00:00
Matt Bierner cc69fb1aad
Switch TS ext to use LogOutputChannel (#179205)
Fixes #176479
2023-04-05 10:44:21 -07:00
Daniel Rosenwasser 93026118c5
Remove Node.js walkthrough/getting started guide (#176325)
Remove Node.js walkthrough/getting started.

Co-authored-by: Matt Bierner <matb@microsoft.com>
2023-04-04 15:27:13 -07:00
Martin Aeschlimann 59608d3aee
Update webpack, css/file & style loaders (#179008) 2023-04-03 16:10:40 +02:00
Matt Bierner b9202b6408
Use better names in js/ts text rendering (#178711)
Use better names
2023-03-30 21:10:51 +02:00
Matt Bierner 0acd272268
Refactor structure of typescript extension (#178634)
There were way to many files under `util`. This change moves around files to more meaningful locations
2023-03-29 16:54:53 -07:00
Matt Bierner ce00cd7812
Add initial prototype for JS/TS move to file refactoring (#178535)
Add initial support for move to file

Fixes #176705
For https://github.com/microsoft/TypeScript/pull/53542
2023-03-28 16:49:50 -07:00
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
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