File tree Expand file tree Collapse file tree 4 files changed +57
-1
lines changed
test/integration-tests/utilities Expand file tree Collapse file tree 4 files changed +57
-1
lines changed Original file line number Diff line number Diff line change 10
10
"lldb.verboseLogging" : true ,
11
11
"lldb.launch.terminal" : " external" ,
12
12
"lldb-dap.detachOnError" : true ,
13
- "swift.sourcekit-lsp.backgroundIndexing" : " off"
13
+ "swift.sourcekit-lsp.backgroundIndexing" : " off" ,
14
+ "swift.exclude" : {
15
+ "**/excluded" : true
16
+ }
14
17
}
Original file line number Diff line number Diff line change
1
+ // swift-tools-version: 5.6
2
+ // The swift-tools-version declares the minimum version of Swift required to build this package.
3
+
4
+ import PackageDescription
5
+
6
+ let package = Package (
7
+ name: " excluded " ,
8
+ products: [
9
+ . library( name: " excluded " , targets: [ " excluded " ] ) ,
10
+ ] ,
11
+ dependencies: [ ] ,
12
+ targets: [
13
+ . target( name: " excluded " ) ,
14
+ ]
15
+ )
Original file line number Diff line number Diff line change
1
+ public struct excluded {
2
+ public private( set) var text = " Hello, World! "
3
+
4
+ public init ( ) {
5
+ }
6
+ }
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the VS Code Swift open source project
4
+ //
5
+ // Copyright (c) 2024 the VS Code Swift project authors
6
+ // Licensed under Apache License v2.0
7
+ //
8
+ // See LICENSE.txt for license information
9
+ // See CONTRIBUTORS.txt for the list of VS Code Swift project authors
10
+ //
11
+ // SPDX-License-Identifier: Apache-2.0
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
15
+ import * as vscode from "vscode" ;
16
+ import { searchForPackages } from "../../../src/utilities/workspace" ;
17
+ import { expect } from "chai" ;
18
+
19
+ suite ( "Workspace Utilities Test Suite" , ( ) => {
20
+ suite ( "searchForPackages" , ( ) => {
21
+ test ( "ignores excluded file" , async ( ) => {
22
+ const folders = await searchForPackages (
23
+ ( vscode . workspace . workspaceFolders ?? [ ] ) [ 0 ] ! . uri ,
24
+ false ,
25
+ true
26
+ ) ;
27
+
28
+ expect ( folders . find ( f => f . fsPath . includes ( "defaultPackage" ) ) ) . to . not . be . undefined ;
29
+ expect ( folders . find ( f => f . fsPath . includes ( "excluded" ) ) ) . to . be . undefined ;
30
+ } ) ;
31
+ } ) ;
32
+ } ) ;
You can’t perform that action at this time.
0 commit comments