Comments (15)
+1, had the same issue in CSS-Files
from autocomplete-paths.
👍
Same problem (in a JavaScript file) immediately after upgrading to 1.0.0.
from autocomplete-paths.
Does anyone have an example file that they can share (perhaps via a gist) that doesn't have any sensitive information? I'd like to include that file in the repo and reproduce this with a test.
from autocomplete-paths.
This looks related to #38...
from autocomplete-paths.
Here's a dummy file filled with JSON you can use to reproduce:
https://gist.github.com/doggan/11feabb4d004332f1aab
Start typing at the bottom of the file (i.e. console.log('hello world');
) with autocomplete-paths enabled and you will see a noticeable delay. Disable the package and the delay disappears.
from autocomplete-paths.
It doesn't seem to be related to line count - I created a 1000 line file with 1 char on each line, then started typing on line 1001: a = https://github.com/hello
. Will try with your file @doggan.
from autocomplete-paths.
Thanks, that file was helpful.
from autocomplete-paths.
This is weird - the size of the file really shouldn't be impacting the time taken to get through this section of code. If anything, the number of files and directories in your current directory should.
This provider should switch to being async in any case.
from autocomplete-paths.
OK, this seems to occur when there is NOT a ./
or /
in front of the path on OS X. I.e. just typing "https" at the bottom of that json file reproduces it.
from autocomplete-paths.
Question: should relative paths that aren't prefixed with ./
(on OS X / Linux) or .\
(on Windows) be shown? if not, this is an easy fix.
from autocomplete-paths.
I'd say 'no'.
Seems like it would cause a lot of interference with standard autocomplete.
from autocomplete-paths.
The regex has to change. It's currently: /[a-zA-Z0-9\.\/_-]*\/[a-zA-Z0-9\.\/_-]*/g
which isn't the best.
from autocomplete-paths.
The regex is doing a global match and there are no line modifiers. https://github.com/atom/atom/blob/98a874808ea00758d84bb45e0b716498d4916b5b/src/cursor.coffee#L504 dictates the start of the range to search being the last non-blank-row, which in your json = the whole document. That's badness, but not causing the issue. The issue is that the prefix could be the entire document in this scenario, which then causes path.basename / path.dirname to take an eternity.
Thanks for reporting this and figuring it out; it gives me a solid lead to create a test and then fix the issue and prevent future regression.
from autocomplete-paths.
The old code that identified the prefix constrained the search to a single line:
prefixOfSelection: (selection) ->
selectionRange = selection.getBufferRange()
lineRange = [[selectionRange.start.row, 0], [selectionRange.end.row, @editor.lineTextForBufferRow(selectionRange.end.row).length]]
prefix = ""
@editor.getBuffer().scanInRange @wordRegex, lineRange, ({match, range, stop}) ->
stop() if range.start.isGreaterThan(selectionRange.end)
from autocomplete-paths.
Thanks for the fix @joefitzgerald! Performance issues seem to be gone. ✨
from autocomplete-paths.
Related Issues (20)
- backslash prefix space in file name
- Is there an analogue of this plugin in VSCode? HOT 4
- How to use autocomplete paths with scss mixins ?
- When editing a .js file, a paths to .vue files are not autocompleted (missing from default-scopes.js)
- Rebuilding cache when modify or create a file HOT 1
- Uncaught TypeError: Cannot read property 'fileCount' of null
- Not working within a .vue file :( HOT 1
- Running the cache collection in a WebWorker/WorkerThread HOT 4
- Improve default scopes HOT 4
- failed to enable package in atom on Ubuntu 20.04 HOT 12
- Tabnine disables autocomplete-paths
- This repo will transfer to atom-ide-community HOT 1
- `exec("find", ["--version"])` not working with Atom from the Electron 9 PR HOT 4
- it doesn't read css directory payh just js directory path HOT 2
- Newly added files are not offered in autocomplete HOT 1
- Can't install or upgrade HOT 10
- Find the best path watcher
- Duplicate autocomplete suggestions with atom-typescript HOT 1
- autocomplete-paths HTML src not working
- This package breaks the autocompletion HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autocomplete-paths.