Skip to content
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

TSServer : make the ScriptInfo standalone #2297

Closed
basarat opened this issue Mar 11, 2015 · 3 comments
Closed

TSServer : make the ScriptInfo standalone #2297

basarat opened this issue Mar 11, 2015 · 3 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@basarat
Copy link
Contributor

basarat commented Mar 11, 2015

In bringing in the efficient line handling / change set handling code from TSServer I've found that the heart of the code is really just the ScriptInfo.

I've needed to bring in all this code : https://github.com/TypeStrong/atom-typescript/blob/bdaff3204ee62de8ab83df962ae224081fbd245b/lib/main/lang/languageServiceHost.ts#L3-L1066

When all I really needed was this : https://github.com/TypeStrong/atom-typescript/blob/bdaff3204ee62de8ab83df962ae224081fbd245b/lib/main/lang/languageServiceHost.ts#L1017-L1066

I don't see host , defaultProject or fileWatcher used https://github.com/Microsoft/TypeScript/blob/37c6f69f015c3da3c709e2bae0786aa55a10a045/src/server/editorServices.ts#L23-L27 would be great if these dependicies were removed and ScriptInfo was made public (exported).

refs TypeStrong/atom-typescript#179

Please correct me if my understanding of this code is correct ❤️

/cc @steveluc @mhegazy

@mhegazy
Copy link
Contributor

mhegazy commented Mar 11, 2015

you are right. a PR would be appreciated :)

one thing to note, i would highly recommend you use the server. I understand from your comment that you have some requirements that you feel the server will not achieve. I think for these we are more than happy to look into and address.

The main issue here, is that the LanguageService API requires a smart host, that leads to plugins falling out of date quickly when new features are added specially these touching resolution (e.g. tsconfig). and just to sight an example we are looking into supporting node module resolution (e.g. looking in node_modules for instance) and possibly some glob support for tsconfig, and so on.. from a plugin point of view, the update would be seamless.

@mhegazy mhegazy added the Question An issue which isn't directly actionable in code label Mar 11, 2015
@basarat
Copy link
Contributor Author

basarat commented Mar 12, 2015

I think for these we are more than happy to look into and address

Specifically this : https://github.com/Microsoft/TypeScript/blob/5141f1d4c984ca256df34a455e96d400a735d3c3/src/server/client.ts#L479-L481

As I understand a client for a TSServer will not get access to Program.

Perhaps it isn't required since new features should be readily accepted into TSServer(https://github.com/Microsoft/TypeScript/blob/5141f1d4c984ca256df34a455e96d400a735d3c3/src/server/session.ts) given due justification?

@mhegazy
Copy link
Contributor

mhegazy commented Mar 12, 2015

As I understand a client for a TSServer will not get access to Program.

That is correct. the problem is the server is used over a text based protocol, and program would not be serializable.

What are you using the program for today?

Perhaps it isn't required since new features should be readily accepted into TSServer(https://github.com/Microsoft/TypeScript/blob/5141f1d4c984ca256df34a455e96d400a735d3c3/src/server/session.ts) given due justification?

That is the other alternative. you can just use session, and do not use the text based server protocol

@mhegazy mhegazy closed this as completed Apr 21, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

2 participants