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

feat: report progress when loading the project #326

Merged
merged 6 commits into from
Dec 10, 2021
Merged

feat: report progress when loading the project #326

merged 6 commits into from
Dec 10, 2021

Conversation

rchl
Copy link
Member

@rchl rchl commented Dec 7, 2021

Added server-initiated progress that notifies the client when the typescript project is being loaded. This should trigger on initial loading and also on changing project settings in tsconfig.json. Basically any time Typescript decides to (re)load the project since it's based on typescript notifications.

Fixes #237

src/lsp-server.ts Outdated Show resolved Hide resolved
src/lsp-server.ts Outdated Show resolved Hide resolved
src/lsp-server.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@predragnikolic predragnikolic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested.

There is a message when the projects starts 'Initializing JS/TS language features'.
There is no message that reports the progress (like 67% of the project is loaded) as I might have initially expected, which would be useful.
And there is no message at the end when the project has been fully.

IMO, for me this is too much code for my taste just to show a 'Initializing JS/TS language features', but I do not have anything against merging this, as the code is readable.

@rchl
Copy link
Member Author

rchl commented Dec 7, 2021

Typescript don't know how long the loading will take so there is no way to show a percentage.

Also it's implied that the project is loading when the string is showing so I wouldn't see any benefit in showing extra message when it has loaded.

This is especially useful for large projects that take many seconds to load. Without the message it's not clear why none of the features (completions, type checking) seem to be working.

@rchl rchl merged commit 4cfff78 into master Dec 10, 2021
@rchl rchl deleted the feat/progress branch December 10, 2021 22:14
rchl added a commit that referenced this pull request Dec 11, 2021
* master:
  chore(deps): update lock file
  fix: ellipsis at the end of the loading project text
  feat: report progress when loading the project (#326)
  chore(deps-dev): bump @typescript-eslint/parser from 5.4.0 to 5.5.0 (#320)
  chore(deps-dev): bump @types/node from 16.11.10 to 16.11.11 (#321)
  chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.4.0 to 5.5.0 (#322)
  chore(deps-dev): bump eslint from 8.3.0 to 8.4.0 (#323)
  feat: implement additional code actions for handling auto-fixing (#318)
  chore(deps-dev): bump @types/node from 16.11.6 to 16.11.10 (#315)
  chore(deps): bump vscode-languageserver-textdocument from 1.0.2 to 1.0.3 (#316)
  chore: add changelog for 0.8.1
  0.8.1
  fix: lookup workspace typescript in dirs higher up the tree also (#314)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to send $/progress messages
2 participants