Commit graph

117 commits

Author SHA1 Message Date
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 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
Greg Van Liew 816f31f691
More settings description tuning (#166429) 2022-11-16 09:33:33 -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
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
Tyler James Leonhardt 4322170fd8
comment is an array (#163348) 2022-10-11 13:39:12 -07: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
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
Andrew Branch 1d16e313d6
[typescript-language-features] Add setting for autoImportFileExcludePatterns (#153160)
* Add setting for autoImportFileExcludePatterns

* Add TS 4.8 to message
2022-06-28 16:43:24 -07:00
Matt Bierner 6428d0fc7d
Support TS's includeInlayVariableTypeHintsWhenTypeMatchesName setting (#150489)
From https://github.com/microsoft/TypeScript/pull/48529

Let users control is variable type inlay hints are suppresed if the variable name matches the type name, such as:

```ts
const range = new Range();
```
2022-05-26 16:00:04 -07:00
Matt Bierner d851ea5d49
Add 'go to source definition' command
Fixes #147532

Requires TS 4.7+
2022-04-19 19:32:19 -07:00
Gabriela Araujo Britto 4e159b9e28
[typescript-language-features] Add includeCompletionsWithObjectLiteralMethodSnippets preference (#145941)
* create flag for object literal method snippet completions

* reword description
2022-03-24 15:17:43 -07:00
Matt Bierner b3832713db
Use esnext as implicit js/ts module
For https://github.com/microsoft/TypeScript/issues/46698

Also adds new settings for the target and module in implicit projects
2022-03-09 14:33:37 -08:00
Ondrej Medek 529cc9c859
fix markdownDescription for javascript.suggest.jsdoc.generateReturns (#144486) 2022-03-07 17:12:55 -08:00
Matt Bierner ad0311a25a
Improve quote style setting display
Follow up on #143164
2022-02-16 12:13:45 -08:00
Matt Bierner 1f5f486ccb
Add note about quote style setting to jsxAttributeCompletionStyle
For #143164
2022-02-16 12:13:45 -08:00
Matt Bierner e784e88a87
Update setting name to be more extensible in the future
Discussed in https://github.com/microsoft/TypeScript/issues/46590#issuecomment-966756378
2021-11-19 15:13:02 -08:00
Alex Dima 3247c31f6a
Replace Right Single Quotation Mark with Single Quote 2021-11-03 23:34:40 +01:00
Gabriela Araujo Britto d2aa181e66
add new 'includeCompletionsWithClasMemberSnippets' option (#136045) 2021-10-28 14:07:11 -07:00
Matt Bierner 12167d7ce8
Note required TS version of JSX completion setting 2021-09-30 17:20:27 -07:00
Stephen Sigwart 2b3f9adf88
Fix typescript NLS JSON (#134179) 2021-09-29 21:13:03 -07:00
Armando Aguirre 7fdc489e08
Add jsxAttributeCompletionStyle setting (#133920)
* Add jsxAttributeCompletionStyle setting

* Apply suggestions from code review

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2021-09-29 16:20:23 -07:00
Matt Bierner 34861b8c8a
Add comments on how fenced code block should not be localized
For #132190
2021-09-07 16:31:45 -07:00
Jonah Snider 19512e92cb
Fix typo in javascript.inlayHints.propertyDeclarationTypes.enabled description (#131760) 2021-08-27 15:20:20 -07:00
Matt Bierner e802791cf1
Introduce typescript.tsserver.useSyntaxServer
Fixes #131142

This setting replaces `typescript.tsserver.useSeparateSyntaxServer` and officailly documents the syntax only mode on desktop
2021-08-18 18:36:37 -07:00
Matt Bierner 67ea45c3e0
Don't use | null for ts config
Fixes #129794

Just fall back to undefined instead
2021-08-02 16:11:17 -07:00
Matt Bierner f5ab4b6292
Clairify enumMemberValues only applies to declaration
Fixes #129516
2021-07-27 16:16:56 -07:00
Matt Bierner 3d244a9a7e
Add language to example code blocks 2021-07-27 16:16:05 -07:00
Matt Bierner 9c12aa144b
Add examples to inlay hint settings
Fixes #129517
2021-07-27 16:08:02 -07:00
Matt Bierner 68b9fd93cc
Note that inlay hints require TS 4.4 2021-07-26 18:12:18 -07:00
Wenlu Wang e144d6e951
Add ts inline hints (#113412)
* Add ts server for inline hints

* Add some feature related configure

* Add more config

* Rename all options

* Support range

* use new interface

* Fix cr issues

* Update inlay hints for ts plugin

* Avoid call chain hints

* Avoid more option

* Update protos

* Update extensions/typescript-language-features/package.nls.json

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Use suppress for some option

* Update CR issues

* Fix missing typedef

* Avoid changes

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-07-07 09:21:20 -07:00
Martin Aeschlimann 32a06b9be2 [typescript] add limited description 2021-05-21 15:38:02 +02:00
Matt Bierner 3915fcfe49
Add some links and small cleanup for JS/TS settings 2021-04-28 17:31:18 -07:00
Matt Bierner ae24966cce
Localize workspaceTrust 2021-04-20 11:35:02 -07:00
Andrew Branch 29ca249959
[typescript-language-features] Support import statement completions for TypeScript 4.3 (#119009)
* Support import statement completions for TypeScript 4.3

* Fix forgotten argument

* Add snippet preference

Co-authored-by: Matt Bierner <matb@microsoft.com>
2021-03-29 11:38:22 -07:00
Matt Bierner e066c74761 Document new fixedChunkSizePolling ts watch mode 2021-03-05 18:49:17 -08:00
Matt Bierner 3dc8cb1afc Add setting to enable/disable returns generation in jsdoc
Fixes #116282
2021-02-10 12:20:01 -08:00
Wahid Shafique 748b2e5a85
Remove # from typescript deprecation warnings (#114787)
Remove tags to match standard deprecation warnings (example dceba9ebb7/extensions/html-language-features/package.nls.json (L32))
2021-01-25 15:37:58 -08:00
Matt Bierner b565c422aa Add find all references command for JS/TS
Fixes #66150
2021-01-04 16:57:24 -08:00
Andrew Casey 9195c9ab14
Expose TS server tracing (#110534)
* Add typescript.tsserver.enableTracing setting

* Document typescript.tsserver.enableTracing setting
2020-11-20 15:28:18 -08:00
Andrew Branch 00fa5d3884
[typescript-language-features] Update importModuleSpecifierPreference values (#110536)
* Update importModuleSpecifierPreference values

* -using

* Add minimum version message
2020-11-16 13:06:40 -08:00
Matt Bierner 81a25a894c Rename implicit project settings and deprecate old ones
For #109990
2020-11-04 14:55:28 -08:00
Matt Bierner 64705a07dc Add two new setting for strict null and strict funtion in js/ts that are implicit projects
For #109988

The new `js/ts.implicitProjectConfig.strictNullChecks` and `js/ts.implicitProjectConfig.strictFunctionTypes` control these settings in implict javascript and typescript files that are not contained in a jsconfig or tsconfig project. They are enabled by default for now so that we can collect feedback on them
2020-11-04 14:33:24 -08:00
Matt Bierner c38a12c26c Quote jsconfig and tsconfig in setting 2020-11-04 14:33:24 -08:00
Matt Bierner 16075cc22a Add insertSpaceAfterOpeningAndBeforeClosingEmptyBrackets formatting setting
Fixes #109190
2020-10-22 22:36:08 -07:00
Eric Piacentini 7e4fd71ad8
Removed lines requiring Typescript version < 3.0 (#104211) 2020-08-10 20:45:11 -07:00
Andrew Branch 4a206a33e5
Change includePackageJsonAutoImports options (#103732) 2020-08-03 14:16:28 -07:00
Andrew Branch 1c8662b8bf
Add setting for package.json auto imports (#103037) 2020-07-22 15:28:22 -07:00
Matt Bierner a4597e1905 Enable JS/TS workspace symbol search for all projects
Fixes #11026

Adds a new `typescript.workspaceSymbols.scope` setting that enables searching all known projects when using TS 3.9+
2020-04-24 00:42:55 -07:00