Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 61 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,66 @@
## Relative path support for Visual Studio Code
Now you can get the relative path to any file in the workspace.
## Relative Path Extension for VS Code

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.
Alternatively, you can press open command palette `F1` and search for `Relative Path`.
> Get the relative path to any file in your workspace

Press `Ctrl+Shift+H` (Mac: `Cmd+Shift+H`) and start typing the file you want.

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

<br/>

## How to use
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`.

## Important
1. [Install the extension](https://marketplace.visualstudio.com/items?itemName=jakob101.RelativePath&ssr=false#overview)
2. Press `Ctrl+Shift+H` (Mac: `Cmd+Shift+H`) and start typing the file you want.
- The file you want will appear as you type
3. 🪄 Select your file from the dropdown!

<br/>

## Options

The following settings are customizable. **You likely do not need these, but if you do, here are your options**

They can be set in user preferences (`ctrl+,` or `cmd+,`) or workspace settings (`.vscode/settings.json`).

```javascript
// A glob by which to filter results
"relativePath.includeGlob": "/**/*.*",

// An array of glob keys to ignore when searching.
"relativePath.ignore": [
"**/node_modules/**",
"**/*.dll",
"**/obj/**",
"**/objd/**"
],

// Excludes the extension from the relative path url (Useful for systemjs imports).
"relativePath.removeExtension": false,

// An array of extensions to exclude from the relative path url (Useful for used with Webpack or when importing files of mixed types)
"relativePath.excludedExtensions": [
".js",
".ts"
],

// For performance optimization the default limit for quick filter is 1,000 files.
// Extending this may lead to performance issues
"relativePath.searchCountLimit": 1000,

// Removes the leading ./ character when the path is pointing to a parent folder.
"relativePath.removeLeadingDot": true,

// "Omit path parts by matched Regular Expressions
"relativePath.omitParts": [
"\\/index$"
],

```

<br/>

## Performance Information

### In Multi root workspaces:

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

### In Single project workspace:

The caching of the filelist in the project happens only once. If your workspace contains a lot of files
please wait for the initial file list to be created.

## Options
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).
```javascript
// An array of glob keys to ignore when searching.
"relativePath.ignore": [
"**/node_modules/**",
"**/*.dll",
"**/obj/**",
"**/objd/**"
],

// Excludes the extension from the relative path url (Useful for systemjs imports).
"relativePath.removeExtension": false,

// For performance optimization the default limit for quick filter is 1000 // files. Extending this limit might lead to performance drop but will
// still provide the quick filtering feature.
"relativePath.extendedLimit": 3000

// An array of extensions to exclude from the relative path url (Useful for used with Webpack or when importing files of mixed types)
"relativePath.excludedExtensions": [
".js"
],
```

## Bugs

Report them [here](https://github.com/jakob101/RelativePath).

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

[MIT](https://github.com/Microsoft/vscode-go/blob/master/LICENSE)
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@
}
],
"configuration": {
"title": "RelativePath extension configuration",
"title": "RelativePath",
"type": "object",
"properties": {
"relativePath.includeGlob": {
"type": "string",
"default": "/**/*.*",
"description": "A glob by which to filter results"
},
"relativePath.ignore": {
"type": "array",
"default": [
Expand All @@ -58,15 +63,15 @@
"relativePath.removeExtension": {
"type": "boolean",
"default": false,
"description": "Excludes the extension from the relative path url (Useful for systemjs imports)."
"description": "Excludes the file extension from the relative path url (Useful for systemjs imports)."
},
"relativePath.excludedExtensions": {
"type": "array",
"default": [
".js",
".ts"
],
"description": "An array of extensions to exclude from the relative path url (Useful for used with Webpack or when importing files of mixed types)"
"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)"
},
"relativePath.removeLeadingDot": {
"type": "boolean",
Expand All @@ -79,6 +84,11 @@
"\\/index$"
],
"description": "Omit path parts by matched Regular Expressions"
},
"relativePath.searchCountLimit": {
"type": "integer",
"default": 1000,
"description": "Max number of files searched in quick filter. Extending this may lead to performance issues."
}
}
}
Expand Down
Loading