forked from dotnet/vscode-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented "Go to Implementation". Closes dotnet#37
- Loading branch information
Showing
6 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
'use strict'; | ||
|
||
import AbstractSupport from './abstractProvider'; | ||
import { FindImplementationsRequest } from '../omnisharp/protocol'; | ||
import * as serverUtils from '../omnisharp/utils'; | ||
import { createRequest, toLocation } from '../omnisharp/typeConvertion'; | ||
import { TextDocument, Position, CancellationToken, ImplementationProvider, ProviderResult, Definition } from 'vscode'; | ||
|
||
export default class CSharpImplementationProvider extends AbstractSupport implements ImplementationProvider { | ||
public provideImplementation(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Definition> { | ||
const request = <FindImplementationsRequest>createRequest(document, position); | ||
|
||
return serverUtils.findImplementations(this._server, request, token).then(response => { | ||
if (!response || !response.QuickFixes) { | ||
return; | ||
} | ||
|
||
return response.QuickFixes.map(fix => toLocation(fix)); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters