Comments (3)
But overall, I don't think I see the utility in ignoring the column variable if it isn't a number or the value is less than zero but throwing an error if the number is greater than lineText.length. I feel like it makes more sense that both edge cases should be treated the same way, or that in the event that colStart is greater than or equal to lineText.length, that it be set to lineText.length - 1.
from atom-linter.
Columns in Atom are zero-indexed, instead of 1-indexed, so <=
length would be incorrect. Can you apply the -1 on ranges from pylint and see if that resolves your issue?
from atom-linter.
It's probably not the newline then. The other indices returned from pylint seem to be accurate, but certain syntax errors in pylint (pylint 2.x at least) consistently give an index of lineText.length+1, and according to its self tests, this seems to be the expected return value. I don't see any other documentation for what that index is supposed to mean, but regardless, it seems there should at least be a way to suppress this exception for certain linters and set the index to either the end of the line or zero.
Since generateRange is doing the work of retrieving the lineText.length itself, there's not really a way to know it a priori without repeating much of the logic from generateRange beforehand to grab the line from the buffer and modify the column index outside of the function.
from atom-linter.
Related Issues (20)
- Fix URLs in package.json
- Make rangeFromLineNumber highlight the whole line if no column is provided HOT 4
- atom-linter 5.x breaking linter HOT 7
- Kill spawned process HOT 3
- Error: spawn crystal ENOENT HOT 5
- Show line number on column errors HOT 1
- Use 1-indexed numbers for invalid ranges? HOT 3
- Handle ENOENT properly
- Rename rangeFromLineNumber HOT 2
- Bring back the old 10 seconds timeout
- Unique Spawning
- Fix documentation of uniqueKey
- Upgrade parse to Message v2 HOT 3
- findAsync with an Array<string> parameter HOT 1
- Configurable timeout HOT 1
- Column start greater than line length for line X HOT 5
- Add CircleCI build state badge in README
- Get rid of consistent-env
- Transferring to AtomLinter organization HOT 3
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 atom-linter.