Slightly off topic but this code in example #5: get() { return new Promise((resolve, reject) => { fetch(`${baseAPI}/heroes`) .then(response => response.json()) .then(json => resolve(json)) .catch(err => { reject (err); }); }); } Why not just: get() { return fetch(`${baseAPI}/heroes`) .then(response => response.json()); }
Because he needs it wrapped in a promise, sending a resolve/reject?
VS Code can do that?
181–190 of 280 posts
Re: VS Code can do that?
#182One thing I really miss in VSCode is Sublime-like search result display in a new tab that shows the result and surrounding lines. The "panel" search results view VSCode has now is far from perfect.
Add this to your settings:
``` "search.location": "panel", ```
Not perfect, but it's a start.
Re: VS Code can do that?
#183Earlier quoted context omitted.
In general, one should serve HTML on the web unless you're doing something that requires JavaScript. JS is a big security/privacy risk. At the moment, I keep JS and CSS off by default on my main browsing profile, overriding it with umatrix when a site requires it and it looks useful enough to bother.
off topic, but how do you turn off first-party JS in umatrix? I switched from NoScript recently, and haven't figured it out yet.
Re: VS Code can do that?
#184My favorite is multi-selection mode. It's not the same as "Column Mode" you find in other IDEs but try it and you will never want another editor again: (Option)Alt-Cmd + Down or Up arrow key From there, you can use arrow keys as normal, but instead of controlling one carrot, you control all the ones you created. So if I use the shortcut key to move to the next word, they all do, same with end of line, or what have yo…
Re: VS Code can do that?
#185In the spirit of cranky HN bikeshedding, I present: The page body, as seen by a NoScript user: Web developers: Please, you can do better than this.
Please know that no one really cares. You must realise you cannot expect to consume our applications but only on your own terms. Theres no contract saying you should ONLY serve HTML on the web.
Re: VS Code can do that?
#186So honored to see Prettier being the #3 tip!
The cognitive load it costs to worry and fret about code formatting....
(thank you)
Re: VS Code can do that?
#187In the spirit of cranky HN bikeshedding, I present: The page body, as seen by a NoScript user: Web developers: Please, you can do better than this.
"Websites should not unnecessarily require JavaScript."
Re: VS Code can do that?
#188Earlier quoted context omitted.
How is the support for cmake?
Not sure. When it comes to C++, I haven't used VS Code a ton. I think last I tried, it didn't really have much integration with my build configuration, and mostly I had to hand-configure the flags via VS Code configuration. Jetbrains CLion is probably advisable if you want good Intellisense on a large CMake project.
https://about.sourcegraph.com/docs/integrations/editor-plugi...
Re: VS Code can do that?
#189Earlier quoted context omitted.
I believe Sublime introduced the feature. I looked it up and it was already present in the first release on January 18, 2008.
Column editing? That was in a shareware text editor that I wrote for Windows in the mid 90s and I didn't invent it.
You can for example put your cursor on a word, spam ctrl+d (of press alt+f3) to select all instances of that word, and start editing them all at ones, no matter where they are. They don't have to be perfectly in a column. You can also copy X items from anywhere, and if you have X cursors again somewhere else and paste, they'll each go in their respective slot.
Re: VS Code can do that?
#190Has anyone figured out how to edit files directly from a remote directory over ssh/ftp?