microsoft / microsoft/TypeScript
Inferred project that currently use "current directory of tsserver host" needs some special handling
@sheetalkamat is already working on this.
Since Sep 6, 2024.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
🔍 Search Terms
Inferred project, tsserver current directory
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
Inferred projects that use tsserver's current directory (eg project root was not specified and is dynamic file or is single inferred project for all loose files). Esp for all the dynamic files (untitled files etc) this means we lookup package.json and files in tsserver current directory (which in most cases is vscode installation location) that seems undesirable but it also involves how to reference these dynamic files and needs some rethinking. it also ends up looking for node_modules/@types for auto type directives as well.
More prominent with #59844 and some of the tests added at https://github.com/microsoft/TypeScript/pull/59869/files#diff-d3671512f8dff77d5eabeb5694d7eae5e9b94e4d50a066c3e0205981fc102e22R59 show this as well.
📃 Motivating Example
Incorrect and unnecessary disk references to non existent files and watching those locations
💻 Use Cases
- What do you want to use this for?
- What shortcomings exist with current approaches?
- What workarounds are you using in the meantime?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.