Live data from Hacker News

VS Code can do that?

vscodecandothat.com

181–190 of 280 posts

Re: VS Code can do that?

#181
post #61

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?

Fetch and response.json() both return promises. So it's still a promise.

Re: VS Code can do that?

#182

One 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.

Check out this: https://github.com/Microsoft/vscode/issues/23931#issuecommen...

Add this to your settings:

``` "search.location": "panel", ```

Not perfect, but it's a start.

Re: VS Code can do that?

#183

Earlier 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.

In the top left of the matrix, click on the `.com` part of the domain. I think that will change the scope to all sites rather than the current domain. Then block the JS column. It should then be blocked by default when you go to new sites.

Re: VS Code can do that?

#184

My 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…

(I think you mean "caret" and not "carrot".)

Re: VS Code can do that?

#185
post #138

In 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.

I'm a true artist and no one understands my genius. Heathens!

Re: VS Code can do that?

#186
post #45

So honored to see Prettier being the #3 tip!

Prettier stopped working for me for 2 weeks some months ago. Least productive 2 weeks for me for a long time.

The cognitive load it costs to worry and fret about code formatting....

(thank you)

Re: VS Code can do that?

#187

In 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.

Your criticism might be better understood with less prejudice; perhaps something like this instead:

"Websites should not unnecessarily require JavaScript."

Re: VS Code can do that?

#188
post #154

Earlier 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.

Or use this VS Code plugin for Intellisense:

https://about.sourcegraph.com/docs/integrations/editor-plugi...

Re: VS Code can do that?

#189

Earlier 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.

Editors like n++ have column editing, but Sublime takes it to a different level. It's most generalized, it's multi-cursor.

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.

Post reply on HN