-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW (Extension) @W-16371431@ Poll ApexGuru API and show the response …
…as diagnostic (#115)
- Loading branch information
Showing
10 changed files
with
375 additions
and
60 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
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
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,42 @@ | ||
/* | ||
* Copyright (c) 2024, Salesforce, Inc. | ||
* All rights reserved. | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
import Sinon = require('sinon'); | ||
import {expect} from 'chai'; | ||
import * as vscode from 'vscode'; | ||
import { ApexLsp } from '../../lib/apex-lsp'; | ||
|
||
suite('ScanRunner', () => { | ||
let executeCommandStub: sinon.SinonStub; | ||
|
||
setup(() => { | ||
executeCommandStub = Sinon.stub(vscode.commands, 'executeCommand'); | ||
}); | ||
|
||
teardown(() => { | ||
executeCommandStub.restore(); | ||
}); | ||
|
||
test('Should call vscode.executeDocumentSymbolProvider with the correct documentUri and return the symbols', async () => { | ||
const documentUri = vscode.Uri.file('test.cls'); | ||
const symbols: vscode.DocumentSymbol[] = [ | ||
new vscode.DocumentSymbol( | ||
'Some Class', | ||
'Test Class', | ||
vscode.SymbolKind.Class, | ||
new vscode.Range(new vscode.Position(0, 0), new vscode.Position(0, 1)), | ||
new vscode.Range(new vscode.Position(0, 0), new vscode.Position(0, 1)) | ||
) | ||
]; | ||
|
||
executeCommandStub.resolves(symbols); | ||
|
||
const result = await ApexLsp.getSymbols(documentUri); | ||
|
||
expect(executeCommandStub.calledOnceWith('vscode.executeDocumentSymbolProvider', documentUri)).to.be.true; | ||
expect(result).to.deep.equal(symbols); | ||
}); | ||
}); |
Oops, something went wrong.