Skip to content

Intelli-sense in extensions file - #26564

Merged
Sandeep Somavarapu (sandy081) merged 5 commits into
microsoft:masterfrom
teintinu:13456a
May 17, 2017
Merged

Sandeep Somavarapu (sandy081) merged 5 commits into
microsoft:masterfrom
teintinu:13456a

Conversation

@teintinu

@teintinu José Fernando Tolentino (teintinu) commented May 12, 2017 •

Copy link
Copy Markdown
Contributor

Intellisense for extensions.json providing installed extensions
from issue #12744

  • Still suggesting examples. Useful when there are no installed extensions

@mention-bot

Copy link
Copy Markdown

Profile moved (@thr0w), thanks for your PR! By analyzing the history of the files in this pull request, we identified Johannes Rieken (@jrieken) and Benjamin Pasero (@bpasero) to be potential reviewers.

@msftclas

Profile moved (@thr0w),
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by Microsoft. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

const range = document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
if (location.path[0] === 'recommendations') {
return vscode.extensions.all
.filter(e => !e.id.startsWith('vscode.'))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • You also need to exclude following extension which is packaged along with VS Code - Microsoft.vscode-markdown. This was getting shown in the intelli-sense.

  • Intelli-sense should not show already entered extensions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sandeep Somavarapu (@sandy081)

  • Excluded Microsoft.vscode-markdown. Can I exclude all packages starting with Microsoft.vscode- ?
  • Intelli-sense should not show already entered extensions: OK
  • Maybe it's better remove: ExtensionsConfigurationSchema / defaultSnippets / Example ?

const location = getLocation(document.getText(), document.offsetAt(position));
const range = document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
if (location.path[0] === 'recommendations') {
const config = vscode.workspace && vscode.workspace.getConfiguration('extensions.json');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do not thinkvscode.workspace.getConfiguration('extensions.json') will get the extension recommendations.
You might have to read the document and parse it. You already have document with text, so you can just use parse from jsonc-parser to get the existing recommendations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok. It's my first try to do something in vscode source. Sorry. I pushed another try.

@sandy081

Copy link
Copy Markdown
Member

LGTM. Thanks a lot for PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants