I'm trying to import a large JSON file but I'm getting this error:
Unexpected token , in JSON at position 197031914
how do i go to that position to fix it?
Thanks!
Besides the recommendations of using a json linter, this extension lets you navigate to a specific offset (position) within a file. You'd want to go to offset 197031914.
Keep in mind that if the file has very long lines, VS Code will not display the entire line. You can try adjusting this limit by following these steps
Just use a JSON linter. There are plenty online, like this one. The linter will point out the specific errors in the syntax of your JSON file.
I know this is an older question but since its getting some views I want to mention how I ended up solving this issue.
Because I was processing huge files (gigabytes), it was not working with linters, so I ended up solving this issue by writing my script that takes a readable stream and find that position and then return the context (x number of charachters before and after position).
I still use it and I might get around to publish it on npm for others to use. (not sure if someone had already done a similar thing);
Looks like you have a one line file. There is an out-of-the-box command to jump to a line number in VS Code. But there is not for a jump to column. So, simply add this VSCode extension to be able to easily jump to a given column on line.
You can auto-fix by linting from the command line using eslint-plugin-json:
$ npm i eslint eslint-plugin-json
$ npx eslint --fix example.json
NOTE: You can get more info about the issue using npx eslint example.json (before fixing).
Related
I'm very new to this and am seeking some explanation/brief guide.
I'm using Pixi.js. I only want to effect certain characters within a string, altering the colour and making some of the characters bold, but not effecting the string as a whole.
I understand this repo GitHub.com/tleunen/pixi-multistyle-text allows you to add XML tags to strings to do this.
What I don't understand is how I can use it on my machine. (I have a moderate understanding of git) but do not know how to use this repo within my currently separate project.
Do I simply need to clone the repo, then copy paste its source file to my project?
I also am not familiar with
$ yarn install
Or
$ yarn build
And when I try to use these within the terminal in code I get many errors!
Anything is appreciated.
(I have limited experience doing gamedev personal projects as a hobby, have never attempted a full 'web dev' project before)
Not sure why you do not want to build it, but you can access or download the distribution files from here:
https://www.jsdelivr.com/package/npm/pixi-multistyle-text
Eclim by default automagically imports java classes when they aren't imported yet. It used to do this successfully, but now the import happens and the line I am currently editing gets deleted.
My hypothesis is that there is some conflicting plugin running at the same time. Whats a good way to figure that out? I tried looking at vim verbose output (via verbosefile) but I am not sure what to look for. Thanks!
Looks like this was just fixed in the source code, you could try patching in this change and rebuilding eclim from source (or waiting for the next release):
https://github.com/ervandew/eclim/pull/529
as far as I know the only way to register aqlfunctions is via arangosh. JS functions very fastly get a few more lines of code which normally also have line breaks for better understanding. Whenever I paste them into the arangosh it gets corrupt as it excepts to get a "proper" end signal/sign. If I don't know it , the only way to reset it is a shotdown. My questions are:
Is there any shortcut like which resets the line input in such a case?
How can I write JS code into several lines and paste them into the arangosh directly?
Is there another way to register (more complex) JS functions I don't know?
Thanks for your help in advance.
<STRG> + D also works in windows.
Multiline doesn't work well with the CMD, it works partly with the cygwin shell window.
However, if the context shows that a function will start (using a brace) it will offer to add another line until the brace closes.
Probably the easiest way to get in more complex code is:
require("internal").load("c:\\tmp\\test.js")
which will be executed right away, so if you define functions in that, they will be usable in the shell context from then on.
When I edit any .coffee file in my mvim and try to save that file with any line longer than 80 symbols, I get such error.
file_name.coffee |18 error| Line exceeds maximum allowed length Length is 91, max is 80.
This is extremely annoying, especially taking into consideration that we have convention of max 100 symbols per line in our company and even code of other team members causes problems for me locally.
The only place where I can change this limit is in nodejs module in file .../node_modules/coffeelint/lib/coffeelint.js, which has such line:
max_line_length: {
value: 80,
-level: ERROR,
+level: IGNORE,
message: 'Line exceeds maximum allowed length'
},
But, of course, editing sources of nodejs libraries is not a good option.
In my mvim I use these dotfiles - https://github.com/skwp/dotfiles
In my project directory I have .coffeelint.json, but it does not work, however, it seems to contain needed and valid code for that (it works perfectly on TravisCI and on machines of other team members).
Questions:
Is there any place where I can turn off coffeelint call when saving file?
Is there any place where I can configure my coffelint max allowed line length?
Update:
Putting properly named (.coffeelint.json) config file into home directory helps, but is not proper solution in my case.
It seems it is more a coffeelint question than a Vim question.
From http://www.coffeelint.org/#options :
It seems you have to generate a configuration file, tweaking the following option.
max_line_length This rule imposes a maximum line length on your code.
Python's style guide does a good job explaining why you might want to
limit the length of your lines, though this is a matter of taste.
Lines can be no longer than eighty characters by default.
default level: error
It also seems you have to call coffeelint with your configuration file:
From : http://www.coffeelint.org/#usage
coffeelint -f coffeelint.json application.coffee
You probably have to find in your dotfile where the coffeelint invocation is done, and add the configuration file with the -f option there.
You don't have to pass the config file explicitly. Here are the user docs for CoffeeLint. You should either create a ~/coffeelint.json file or create a coffeelint.json in the root of your project.
In all project parts (5 different repos now) we currently have .coffeelint.json file, that is not the proper name for coffeelint, if you want it to pick config file automatically. Current .coffeelint.json is used on TravisCI when checking code and is invoked with -f option, as it turned out. So I my case I have two ways to fix weird behaviour (that is intended behaviour, actually):
Copy one of the configs from 5 related repos to ~/coffeelint.json, so that coffeelint will use it automatically when vim will check file on save (but this will not do if some repos will have different configs, however, this solution does not require any changes to repos).
Create copy of each config file in each repository (so I'll have both .coffeelint.json and coffeelint.json in each repo) and add the newly added one to .gitignore, so that team members will not see it in their editors. This option is also inappropriate and looks ugly, cause I have to add 5 changes and 5 commits.
It seems that guys from the team decided to name coffeelint config file not properly in order to hide it visually in code editors. Solution cost me nerves, so, probably, I'll reconfigure everything properly and will rename configs to default names.
It would be nice if coffeelint supported multiple config files with levels of priority, but this is not possible now.
I'm trying to add this p4sql query as a Custom Tool in P4V (Windows) by adding p4sql.exe as the application and
-s "select * from changes where lcase(description) like '$%$D$%' and p4options='longdesc';"
as Arguments.
When I execute the command and enter '123' as input, the following error comes back:
p4sql error:
Usage: p4sql -h for usage.
Option: 12 is undefined.
What escape mechanism am I missing?
I recently updated the question you referenced and, as I stated, there is a bug in P4V, and P4SQL seems pretty flaky as well. You can get it to work some of the time if you put spaces between the "$%" and the "$D". Change this:
...like '$%$D$%' and...
to this:
...like '$% $D $%' and...
It will work some of the time after making this change, but some searches will still fail as those spaces become part of the search string. I've also noticed some searches fail for reasons I can't explain. I reported this to Perforce last October, and they confirmed it was a bug, but have yet to fix it.
You're better off using one of the solutions mentioned in the other question. Use P4Win or dump the change lists to a file and then search the file.