-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support communicating with tsserver using IPC #585
Conversation
I love the idea here! Anything others can do to help? |
} | ||
|
||
export const nodeRequestCancellerFactory = new class implements OngoingRequestCancellerFactory { | ||
create(/*serverId: string, tracer: Tracer*/): OngoingRequestCanceller { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should /*serverId: string */
be commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should as it's not used currently. But forgot to comment out in the interfaces also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like serverId is not necessary or used in NodeRequestCanceller,
but it just looked strange to see serverId
being commented out only for this method.
import { NodeTsServerProcessFactory } from './serverProcess.js'; | ||
import type { TypeScriptVersion } from './versionProvider.js'; | ||
|
||
export class TypeScriptServerSpawner { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it maybe planned to have multiple processes for each TsServerProcessKind
?
export const enum TsServerProcessKind {
Main = 'main',
Syntax = 'syntax',
Semantic = 'semantic',
Diagnostics = 'diagnostics'
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if multiple for each but I don't think so...
It would be one of each at most, I imagine.
Ported a bunch of code from "VSCode typescript features" to enable us to be able to communicate with
tsserver
over IPC instead ofstdio
. IPC is used for tsserver (typescript) versions 4.60+, otherwise the legacy stdio is used.If this seems like a lot of code to handle that case then yes, it is, but it's part of the plan to align the code as closely as possible with VSCode to be able to support features like #358 without re-inventing the wheel.