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

Document Highlight spec unclear and possibly wrong #32

Closed
smarr opened this issue Jul 7, 2016 · 11 comments
Closed

Document Highlight spec unclear and possibly wrong #32

smarr opened this issue Jul 7, 2016 · 11 comments

Comments

@smarr
Copy link

smarr commented Jul 7, 2016

As discussed and noted in issue #18, there might be something wrong with the document highlight spec (see #18 (comment) and below).

Furthermore, the wording of the spec does not tell me what this feature is for (apparently something like 'mark occurrences'), so, it's unclear to me at the moment.

The distinction between read/write/text is unclear to me, too. What is it useful for exactly? (Would be good to know so that I know how to map it to my language.)

And, the vscode apparently also expects a collection of elements as return value, as noted by @cdietrich:

export interface DocumentHighlightProvider {
  provideDocumentHighlights(model: editor.IReadOnlyModel, position: Position, token: CancellationToken): DocumentHighlight[] | Thenable<DocumentHighlight[]>;
}
@dbaeumer
Copy link
Member

@smarr to which code base are you referring to with

export interface DocumentHighlightProvider {
  provideDocumentHighlights(model: editor.IReadOnlyModel, position: Position, token: CancellationToken): DocumentHighlight[] | Thenable<DocumentHighlight[]>;
}

Is this from the Monaco editor?

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Jul 13, 2016
@cdietrich
Copy link

cdietrich commented Jul 13, 2016

if i try to implement the document highlight in the node example it wants me to do something like+

connection.onDocumentHighlight((p : TextDocumentPositionParams): DocumentHighlight[] => {
    console.log("highlihht");
    return[
        {
            kind: 1,
            range: {
                start : {
                    line : 1, character : 1
                },
                end : {
                    line : 1, character : 3
                }
            } 
        },
        {
            kind: 1,
            range: {
                start : {
                    line : 1, character : 4
                },
                end : {
                    line : 1, character : 7
                }
            } 
        }
    ]
});

@cdietrich
Copy link

and it is in monaco.d.ts as well

@cdietrich
Copy link

any news on this?

@egamma
Copy link
Member

egamma commented Jul 26, 2016

@cdietrich sorry vacation time here, delays are to be expected...

@cdietrich
Copy link

@dbaeumer @egamma let me know if you need additional info

@dbaeumer
Copy link
Member

I updated the protocol definition like this:

capture

@dbaeumer dbaeumer removed the info-needed Issue requires more information from poster label Aug 18, 2016
@cdietrich
Copy link

@dbaeumer at other places you use Type[] as list notation

@dbaeumer
Copy link
Member

Good catch. Fixed it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants