* Prototype TS plugins on web
This prototype allows service plugins to be loaded on web TSServer
Main changes:
- Adds a new host entryPoint called `importServicePlugin` for overriding how plugins can be loaded. This may be async
- Implement `importServicePlugin` for webServer
- The web server plugin implementation looks for a `browser` field in the plugin's `package.json`
- It then uses `import(...)` to load the plugin (the plugin source must be compiled to support being loaded as a module)
* use default export from plugins
This more or less matches how node plugins expect the plugin module to be an init function
* Allow configure plugin requests against any web servers in partial semantic mode
* Addressing some comments
- Use result value instead of try/catch (`ImportPluginResult`)
- Add awaits
- Add logging
* add tsserverWeb to patch in dynamic import
* Remove eval
We should throw instead when dynamic import is not implemented
* Ensure dynamically imported plugins are loaded in the correct order
* Add tests for async service plugin timing
* Update src/server/editorServices.ts
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Partial PR feedback
* Rename tsserverWeb to dynamicImportCompat
* Additional PR feedback
Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Allow instantiation expression to be followed by let or interface on new line
* Add tests
* Update src/compiler/parser.ts
* Instantiation expressions followed by line breaks or binary operators
* Add more tests
* Accept new baselines
* Fix lint error
* Update fourslash test
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Merge 'decorators' into 'modifiers' on various Nodes
* Drop RESERVED argument in favor of removing parameter
* Ignore grammar error nodes when asserting invariants
* Revert 'illegalX' property renames
* PR Feedback
* Convert some of the watchEnvironment tests to baselines for updating later
* Add tests for inode watching by making fsWatch part of system function that tests presence before creating fs watch
* Refactor for simpler tests
* Accept map of file content or file or symlink or folder
* Add test when rename event occurs when file has already reappeared
* On rename event for the file, replace file watcher irrespective of file presence
* Fix regex
* Ensure that when doing inode watching watchers is replaces only on disappearance or appearance
* Some logging for debugging further
* Revert "Some logging for debugging further"
This reverts commit dd2164ac83666725c4cc58e0223425b10530d682.
* Add test when rename event occurs on mac with ~ appended to file name
* If the relativeFileName ends with tilde, remove it from the event
* Some logging for debugging further
* Revert "Some logging for debugging further"
This reverts commit e1ba8a8d5f2f30cc039a89a1e8e4e6c64ba7c44d.
* Add documentation and fail safe the event firing
* Revise and simplify CFA for `typeof` check expressions
* Accept new baselines
* Add regression test
* Slight change to preserve type when related in both directions
* Add regression test
* Explain reasons for exact sequence of type checks
* Use fixed time for vfs so baselining is consistent
* Baseline buildinfos
* Write new file text in baseline even if the file wasnt read on the shadow
* Remove unnecessary debugger statement
* Make sure that incremental correctness is checked with correct writeFile so we know buildInfo was written
Also baseline these so its easy to verify the changes
* More baselines for the tsbuildinfo
* If we are writing dts file and have used file text as version, we can update the signature when doing actual emit
* Make WriteFileCallback Api ready for future
* Assert that there is only single source file when emitting d.ts file
* Add test
* Renames
* More refactoring
* If we are updating dts of any of the file and it affects global scope, everything needs update in signature and dts emit
Fixes#42769
* Stacktrace optimization for getModified time in anticipation of using it more than fileExists wherever possible
* Baseline getModifiedTime, setModifiedTime, fileExits and directoryExits for experiment
* Remove unnecessary write file finger print code since its not used at all
* Use modified time instead of file existence check
* Remove unnecessary getModifiedTime
* No need to check for file existence before reading the d.ts file
* Do project reference errors before doing input/output file checks
* Dont call getModifiedTimes if dts change
* Passdown modified time if queried
* Use modified time passed through the file watching in tsbuild
* Handle force build as separate upto date status
* uptodate status worker to read buildinfo and use it to determine upto date ness
* No need to update output timestamps if buildinfo will determine uptodateness
* Store change file set instead of hasPendingChange to be able to reuse the information
* Add test that shows input file is not present
* No need to check input time stamp before buildinfo
* Keep buildinfos for lifetime of the solution builder and project
* Store modified time along with text of buildinfo
* Non composite projects dont need to track declaration change time
* Pass through buildInfo so we dont have to parse it back
* Save dts change time in buildinfo itself
* Store dts time for --out in the buildInfo
* Store hash of text in the bundle info so it can be verified before manipulating text for fast updates during prepend
This helps when text changes during incremental build toggling and we determine we can just manipulate text
* Since buildinfo is cached no need to maintain version check state
* Store output time stamps for non incremental builds
* Revert "Baseline getModifiedTime, setModifiedTime, fileExits and directoryExits for experiment"
This reverts commit 7e65cd3315ccf387f6d7e7c40263e85bcc3c961c.
* Change verbose messages for upto date status
* Reconcile reusable builder state and builder state so there are not two different types that are almost similar looking
* Cleanup impliedFormat
* Cleanup
* Cleanup noEmit option
* BuildInfo options emit as a flag
* Factor out types for program written in buildinfo with and without bundle emit
* No need to store output file stamps if not in watch mode
* Cleanup
* Test for single watch per file
* Fix emit and error update baselines that were duplicate
* More refactoring
* Only copy emit state fields when backing up to restore if emit fails
* Instead of maintaining delta of changes, maintain old state for those changes
* Add test to verify build when input file does not change
* If version of the input file does not change, dont mark as out of date
* Disable lint warning as build fails without the assert
* Report aggregate statistics for solution as well as some solution perf numbers
* Options solutionDiagnostics instead so that its not too verbose when printing diagnostics
* When tsc --build --clean, only remove tsbuildinfo if its incremental build
* Revert "Options solutionDiagnostics instead so that its not too verbose when printing diagnostics"
This reverts commit 0cf9e301038267bc1d9439c15d279940809b0c00.
* Revert "Report aggregate statistics for solution as well as some solution perf numbers"
This reverts commit 405d8e91978708a613fe8cb631a83b13c430a808.
* Revert "When tsc --build --clean, only remove tsbuildinfo if its incremental build"
This reverts commit e4e66726098201f38f5e8908a538e7a506f15efd.
* Comments in the code
* Feedback
* fix(49223): handle ExpressionWithTypeArguments nodes in isExpressionNode
* Update src/compiler/utilities.ts
* Just use `!isHeritageClause(node.parent)`.
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Remove undefined from source type of destructuring assignment with renaming
* add a test
* add test case from original issue
* add test with undefined default value
* add more test cases with const declaration
* changed error message for interface extending primitive type
* moved interface check to different function
* changed part of interface declaration to is extended by interface
Co-authored-by: harsheetkakar <harsheetkakar@bitbucket.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>