Code Monkey home page Code Monkey logo

explorer-excluded-files's People

Contributors

sadesyllas avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

michaelherger

explorer-excluded-files's Issues

Read all of Git's documented .gitignore files by default

The default setting of

"explorerExcludedFiles.patterns" : [
    "file://.gitignore"
]

should be changed to something like:

"explorerExcludedFiles.patterns" : [
    "file://${XDG_CONFIG_HOME}/git/ignore",
    "file://${HOME}/.config/git/ignore",
    "file://${USERPROFILE}/.config/git/ignore",
    "file://.git/info/exclude",
    "file://**/.gitignore"
]

This is ordered so that the highest-priority file appears last.

  • The entries with ${XDG_CONFIG_HOME} and ${HOME} should be done only on Linux and macOS, while the entry with ${USERPROFILE} should be done only on Windows. (These are expressed in terms of environment variables; I'm not sure if these are currently supported.)
  • The final entry uses a wildcard to find .gitignore files in subdirectories. The current implementation doesn't support wildcards, so that will need to be implemented.
  • Ideally the filepath given in the output of the command git config --get core.excludesFile should also be considered before all others.

Does not work with Remote SSH

Got next error from runtime status
ENOENT: no such file or directory, open '/home/[username]/.config/Code/User/settings.json'

After creating empty settings.json file with only {} structure got error related to json

Extension updates .vscode/settings.json every few seconds

Basically bug #1 is back: the extension is checking its state every few seconds. While doing so it would first clean out the ignore list, then add its own items. Both actions would write the file, resulting in at least two writes per workspace folder.

Another issue seems to be that with no configuration given for a folder, it would compare workspaceConfigurationText and workspaceConfiguration. While the former would be initialized, the latter is not. Which means that the former would become {files.exclude:{}} by default, but workspaceConfigurationText would stay {} - causing the re-build of the file when no exclusion is defined in a project.

The fix probably would be to only modify the data during cleanWorkspaceConfiguration and patch*Configuration in memory, then run the configurationsAreIdentical check on that value. Otherwise that check would always fail.

Error if settings has a C-style comment

If settings.json has something like /* I'm a C-style comment */ and you try to run command Hide Explorer Excluded Files, then you will get the following...

error: command 'extension.hideExplorerExcludedFiles' not found

and in the console:

mainThreadExtensionService.ts:110
Activating extension `sadesyllas.explorer-excluded-files` failed:
Unexpected token / in JSON at position 131.

Feature request: do not write empty object

I regularly open subfolders in vscode to cut out a lot of the noise when working. This causes this extension to write { "files.exclude": {} } in a .vscode folder there, which I then have to remove again later.

Could this extension not write when there are no ignored files? Cheers!

Doesn't recognise ! negations

The .gitignore format supports negations with the ! prefix. For example, to ignore wp-*.php but not wp-config.php:

node_modules/
!wp-config.php
wp-*.php

Right now, explorer-excluded-files doesn't recognise the negation, and includes the whole line in files.exclude:

  "files.exclude": {
    "node_modules/": "explorerExcludedFiles",
    "wp-*.php": "explorerExcludedFiles",
    "!wp-config.php": "explorerExcludedFiles"
  }

Doesn't match files in subdirectories by default, doesn't match files relative to .gitignore file

According to the .gitignore documentation:

  • If I have this pattern in my workspace-level .gitignore: *.o, then Git ignores .o files in both the top-level directory and any subdirectories. (Git also behaves the same way if I specified it like: **/*.o. A non-trailing ** means "match zero or more directories", while a trailing /** means "match all files and directories inside this directory".)
  • Pattern-matching occurs downwards from the location of the .gitignore file in which the pattern occurs, but not upwards. So if I have *.o in my a/.gitignore file in my repo, then Git will ignore a/hello.o and a/c/foo.o, but not b/bar.o.

Neither of these behaviors are replicated in VSCode by this plugin.

  • VSCode's files.exclude seems to always need patterns to start with **/ in order for them to match files in subdirectories. (The plugin should cater for this by prepending each pattern with **/ if it does not already begin with it.)
  • The patterns from my provided .gitignore file are directly enlisted in files.exclude without regard to the location of the .gitignore file the pattern is from. The plugin should cater for this by prepending each pattern with the directory of the contributory .gitignore file, and a / (and then **/ as above).

Finally, the README.md says:

If you specify a pattern beginning with file://, e.g., "file://.gitignore", the pattern is interpreted as a file...

This led me to believe that I can get the plugin to pick up all my subdirectory-level .gitignore files by having something like "file://**/.gitignore". I was wrong; perhaps it would be good to rephrase it to avoid confusion:

If you specify an entry beginning with file://, e.g., "file://.gitignore", the entry is interpreted as a file...

Plugin only reads Workspace-level Settings, and not User-level Settings

I tried adding enlisting some subdirectory-level .gitignore files in my User Settings, but they were not considered at all. It only works if I enlist them in my Workspace Settings.

For consistency with other settings of VS Code configuration, the plugin should respect both User Settings and Workspace Settings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.