Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit89cdae0

Browse files
avoid throwing error for single-file mode task configuration (microsoft#6828)
* change master to main* ignore single-mode files error* linter error
1 parentf73a5d1 commit89cdae0

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

‎Extension/src/LanguageServer/cppBuildTaskProvider.ts‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import*aspathfrom'path';
66
import{
77
TaskDefinition,Task,TaskGroup,ShellExecution,Uri,workspace,
8-
TaskProvider,TaskScope,CustomExecution,ProcessExecution,TextEditor,Pseudoterminal,EventEmitter,Event,TerminalDimensions,window
8+
TaskProvider,TaskScope,CustomExecution,ProcessExecution,TextEditor,Pseudoterminal,EventEmitter,Event,TerminalDimensions,window,WorkspaceFolder
99
}from'vscode';
1010
import*asosfrom'os';
1111
import*asutilfrom'../common';
@@ -181,13 +181,18 @@ export class CppBuildTaskProvider implements TaskProvider {
181181
};
182182
}
183183

184-
constactiveClient:Client=ext.getActiveClient();
185-
consturi:Uri|undefined=activeClient.RootUri;
186-
if(!uri){
187-
thrownewError("No client URI found in getBuildTasks()");
188-
}
189-
if(!workspace.getWorkspaceFolder(uri)){
190-
thrownewError("No target WorkspaceFolder found in getBuildTasks()");
184+
consteditor:TextEditor|undefined=window.activeTextEditor;
185+
constfolder:WorkspaceFolder|undefined=editor ?workspace.getWorkspaceFolder(editor.document.uri) :undefined;
186+
// Check uri exists (single-mode files are ignored).
187+
if(folder){
188+
constactiveClient:Client=ext.getActiveClient();
189+
consturi:Uri|undefined=activeClient.RootUri;
190+
if(!uri){
191+
thrownewError("No client URI found in getBuildTasks()");
192+
}
193+
if(!workspace.getWorkspaceFolder(uri)){
194+
thrownewError("No target WorkspaceFolder found in getBuildTasks()");
195+
}
191196
}
192197

193198
constscope:TaskScope=TaskScope.Workspace;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp