microsoft / microsoft/language-server-protocol

New CompletionItemTag for inaccessible entities

Open
#1,044 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

completion feature-request
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

We propose a new CompletionItemTag value to mark completion element that isn't directly visible at completion point.

For instance, in Ada "context clauses" enable visibility of entities in given compilation unit:

with Ada.Text_IO;
procedure Hello_World is
begin
   Ada.Text_IO.Put_Line ("Hello");
end;

Procedure Put_Line isn't visible without the with Ada.Text_IO; clause. But it's still desirable to have
completions for such invisible/inaccessible entities, so user is able to chose it and then add a context clause latter. IDE should highlight inaccessible completion items (for instance with gray) to let user know that this item
isn't a truly correct completion. To distinguish such items we propose a new CompletionItemTag value:

export namespace CompletionItemTag {
	/**
	 * Render a completion as obsolete, usually using a strike-out.
	 */
	export const Deprecated = 1;
	/**
	 * Render a completion as inaccessible, usually using a gray out font.
	 */
	export const Inaccessible = 2;
}

I think other languages could benefit from this too.

example

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the CompletionItemTag definition and related Language Server Protocol specification sections. Check how existing tags such as Deprecated are documented and represented, then determine the compatibility and wording requirements for an Inaccessible tag. Done means the protocol proposal is resolved and the corresponding specification changes are agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.