Skip to content

Commit 4754f1a

Browse files
charlieclarkcclark-squarespacedawsbot
authored
✨ Add includeGlob settings and rename searchCountLimit setting (#32)
* add an include option and some misc fixes * Fix extension integer * prettier * Cleanup option names * Cleanup settings names Co-authored-by: Charlie Clark <[email protected]> Co-authored-by: daws.eth <[email protected]>
1 parent 446ec81 commit 4754f1a

File tree

3 files changed

+223
-115
lines changed

3 files changed

+223
-115
lines changed

README.md

Lines changed: 61 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,66 @@
1-
## Relative path support for Visual Studio Code
2-
Now you can get the relative path to any file in the workspace.
1+
## Relative Path Extension for VS Code
32

4-
Just press `Ctrl+Shift+H` (Mac: `Cmd+Shift+H`) and select a file. If your workspace has more than 1000 files, you will be prompted to filter that list first.
5-
Alternatively, you can press open command palette `F1` and search for `Relative Path`.
3+
> Get the relative path to any file in your workspace
4+
5+
Press `Ctrl+Shift+H` (Mac: `Cmd+Shift+H`) and start typing the file you want.
66

77
![GIF](https://media.giphy.com/media/3oEduJ5iRksPxpwoXC/giphy.gif)
88

9+
<br/>
10+
911
## How to use
10-
First, you will need to install Visual Studio Code. In the command palette (`Ctrl-Shift-P` or `Cmd-Shift-P`) select `Install Extension` and choose `RelativePath`.
1112

12-
## Important
13+
1. [Install the extension](https://marketplace.visualstudio.com/items?itemName=jakob101.RelativePath&ssr=false#overview)
14+
2. Press `Ctrl+Shift+H` (Mac: `Cmd+Shift+H`) and start typing the file you want.
15+
- The file you want will appear as you type
16+
3. 🪄 Select your file from the dropdown!
17+
18+
<br/>
19+
20+
## Options
21+
22+
The following settings are customizable. **You likely do not need these, but if you do, here are your options**
23+
24+
They can be set in user preferences (`ctrl+,` or `cmd+,`) or workspace settings (`.vscode/settings.json`).
25+
26+
```javascript
27+
// A glob by which to filter results
28+
"relativePath.includeGlob": "/**/*.*",
29+
30+
// An array of glob keys to ignore when searching.
31+
"relativePath.ignore": [
32+
"**/node_modules/**",
33+
"**/*.dll",
34+
"**/obj/**",
35+
"**/objd/**"
36+
],
37+
38+
// Excludes the extension from the relative path url (Useful for systemjs imports).
39+
"relativePath.removeExtension": false,
40+
41+
// An array of extensions to exclude from the relative path url (Useful for used with Webpack or when importing files of mixed types)
42+
"relativePath.excludedExtensions": [
43+
".js",
44+
".ts"
45+
],
46+
47+
// For performance optimization the default limit for quick filter is 1,000 files.
48+
// Extending this may lead to performance issues
49+
"relativePath.searchCountLimit": 1000,
50+
51+
// Removes the leading ./ character when the path is pointing to a parent folder.
52+
"relativePath.removeLeadingDot": true,
53+
54+
// "Omit path parts by matched Regular Expressions
55+
"relativePath.omitParts": [
56+
"\\/index$"
57+
],
58+
59+
```
60+
61+
<br/>
62+
63+
## Performance Information
1364

1465
### In Multi root workspaces:
1566

@@ -18,35 +69,14 @@ cached to improve search performance. If you have multiple large folders part of
1869
frequent switches between folders might slow you down.
1970

2071
### In Single project workspace:
72+
2173
The caching of the filelist in the project happens only once. If your workspace contains a lot of files
2274
please wait for the initial file list to be created.
2375

24-
## Options
25-
The following Visual Studio Code settings are available for the RelativePath extension. They can be set in user preferences (`ctrl+,` or `cmd+,`) or workspace settings (.vscode/settings.json).
26-
```javascript
27-
// An array of glob keys to ignore when searching.
28-
"relativePath.ignore": [
29-
"**/node_modules/**",
30-
"**/*.dll",
31-
"**/obj/**",
32-
"**/objd/**"
33-
],
34-
35-
// Excludes the extension from the relative path url (Useful for systemjs imports).
36-
"relativePath.removeExtension": false,
37-
38-
// For performance optimization the default limit for quick filter is 1000 // files. Extending this limit might lead to performance drop but will
39-
// still provide the quick filtering feature.
40-
"relativePath.extendedLimit": 3000
41-
42-
// An array of extensions to exclude from the relative path url (Useful for used with Webpack or when importing files of mixed types)
43-
"relativePath.excludedExtensions": [
44-
".js"
45-
],
46-
```
47-
4876
## Bugs
77+
4978
Report them [here](https://github.com/jakob101/RelativePath).
5079

5180
## Licence
52-
[MIT](https://github.com/Microsoft/vscode-go/blob/master/LICENSE)
81+
82+
[MIT](https://github.com/Microsoft/vscode-go/blob/master/LICENSE)

package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,14 @@
3939
}
4040
],
4141
"configuration": {
42-
"title": "RelativePath extension configuration",
42+
"title": "RelativePath",
4343
"type": "object",
4444
"properties": {
45+
"relativePath.includeGlob": {
46+
"type": "string",
47+
"default": "/**/*.*",
48+
"description": "A glob by which to filter results"
49+
},
4550
"relativePath.ignore": {
4651
"type": "array",
4752
"default": [
@@ -58,15 +63,15 @@
5863
"relativePath.removeExtension": {
5964
"type": "boolean",
6065
"default": false,
61-
"description": "Excludes the extension from the relative path url (Useful for systemjs imports)."
66+
"description": "Excludes the file extension from the relative path url (Useful for systemjs imports)."
6267
},
6368
"relativePath.excludedExtensions": {
6469
"type": "array",
6570
"default": [
6671
".js",
6772
".ts"
6873
],
69-
"description": "An array of extensions to exclude from the relative path url (Useful for used with Webpack or when importing files of mixed types)"
74+
"description": "An array of file extensions to exclude from the relative path url (Useful for used with Webpack or when importing files of mixed types)"
7075
},
7176
"relativePath.removeLeadingDot": {
7277
"type": "boolean",
@@ -79,6 +84,11 @@
7984
"\\/index$"
8085
],
8186
"description": "Omit path parts by matched Regular Expressions"
87+
},
88+
"relativePath.searchCountLimit": {
89+
"type": "integer",
90+
"default": 1000,
91+
"description": "Max number of files searched in quick filter. Extending this may lead to performance issues."
8292
}
8393
}
8494
}

0 commit comments

Comments
 (0)