eclipse-wildwebdeveloper / wildwebdeveloper

Simple and productive Web Development Tools in the Eclipse IDE
https://projects.eclipse.org/projects/tools.wildwebdeveloper
Eclipse Public License 2.0
189 stars 70 forks source link

Autocomplete package.json dependencies versions #277

Open nino-magazinovic opened 4 years ago

nino-magazinovic commented 4 years ago

Wild Web Developer: 0.7.0.201910102046

Autocomplete of angular.json and package.json properties works, but autocomplete of package.json dependency versions is missing (dependencies, devDependencies, peerDependencies).

nino-magazinovic commented 4 years ago

Would be great to include feature as on https://semver.npmjs.com/.

Example:

"peerDependencies": {
  "lodash": "^1.0"
}

Completion should list versions that are calculated to the input ^1.0 or 1.x:

"1.0.0", "1.0.1", ..., "1.1.0", ..., "1.3.0", "1.3.1"

Completion on empty input should list the latest version including caret and tilde:

"4.17.15", "^4.17.15", "~4.17.15", 
mickaelistria commented 4 years ago

I'm not aware of a language server we could reuse to provide that feature, and we cannot/shouldn't include such smartness directly in Wild Web Developer (we'd rather work on an independent language server to reuse in multiple IDEs). I've asked on https://github.com/theia-ide/typescript-language-server/issues/126 whether this could be in the scope of the JS/TS language server we're using.

angelozerr commented 4 years ago

vscode supports this feature (npm and bower). The code is managed with https://github.com/microsoft/vscode/blob/master/extensions/npm/src/features/jsonContributions.ts

The bad thing is that it uses vscode API, but I think this code could be LSPfied and it could be an extension of the JSON language server since https://github.com/microsoft/vscode/blob/master/extensions/npm/src/features/jsonContributions.ts is a contribution of vscode-json-languageservice I think.