Skip to content

TSServer : make the ScriptInfo standalone #2297

Closed

Description

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 Steve Lucco (@steveluc) Mohamed Hegazy (@mhegazy)

Activity

  1. mhegazy commented on Mar 11, 2015

    @mhegazy
    Contributor

    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.

  2. basarat commented on Mar 12, 2015

    @basarat
    ContributorAuthor

    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?

  3. mhegazy commented on Mar 12, 2015

    @mhegazy
    Contributor

    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

  4. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions