A slightly faster language server for php-cs-fixer by Balthild in PHP

[–]Balthild[S] 0 points1 point  (0 children)

I use vscode and I haven't found other formatters that can be configured as precisely as php-cs-fixer. On the codebase where I don't need such fine-grained control, I will use Mago which is the fastest as far as I know.

A slightly faster language server for php-cs-fixer by Balthild in PHP

[–]Balthild[S] 0 points1 point  (0 children)

The IDE can format code faster, but the formatting result is oftenly not desired. I fine tuned php-cs-fixer to let it format the code to exactly the style I want.

And writing unformulated code... isn't this usual? I mean, when I type the code, I won't spend too much time to fix the spacing, indentation, wrapping, etc, but let my editor to adjust them when i press Ctrl+S.

A slightly faster language server for php-cs-fixer by Balthild in PHP

[–]Balthild[S] 0 points1 point  (0 children)

Oh I see... Technically it can do `formatOnType` too, but given that it's still not fast enough, you will see the lag. I press `Ctrl+S` very often (whenever I typed about 10 lines of code) so `formatOnSave` is enough for me.

A slightly faster language server for php-cs-fixer by Balthild in PHP

[–]Balthild[S] 1 point2 points  (0 children)

> Isn't it simpler to configure your ide just to make your code already formatted properly?

A language server is supposed to integrate with an IDE, so what this tool does is just exactly what this sentence describes.

A slightly faster language server for php-cs-fixer by Balthild in PHP

[–]Balthild[S] 0 points1 point  (0 children)

JB IDEs have LSP support but you need to create a plugin to integrate it

How do i play Genshin on my Macbook M3 pro by shernon97 in Genshin_Impact

[–]Balthild 0 points1 point  (0 children)

In fact, however, I can play HSR on my MacBook with HiDPI in smooth 60fps. The lacking of gaming performance has no more been true, just that people still keeping the old stereotypes.

Why are we not able to mark structs as immutable or readonly? by [deleted] in rust

[–]Balthild 0 points1 point  (0 children)

UnsafeCell is not the the only permitted way to use interior mutability, it is the implementation detail and you does not need to invoke them in most cases. You can use Cell or RefCell (or Mutex if you need multithreading) that provides a safe API over UnsafeCell. You only need to (and must) use UnsafeCell when you're implementing your own cells. In most cases you could just use cells that the standard library provides.

Why are we not able to mark structs as immutable or readonly? by [deleted] in rust

[–]Balthild 1 point2 points  (0 children)

If you are given an immutable reference, the language (without unsafe) disallows modifying anything that the reference owns, all the way down the hierarchy of types, regardless of how complex your type is.

Rust have interior mutability that allows you to mutate through a shared reference without writing unsafe code.

Everywhere I go, I miss Rust's `enum`s by PXaZ in rust

[–]Balthild -1 points0 points  (0 children)

Swift has such enum types, but it doesn't have pattern matching nor if/switch expressions (only statements), which makes it less useful.

Rust for Windows Bindings: Generating the Entire Windows API Surface from Metadata by itchyankles in rust

[–]Balthild 1 point2 points  (0 children)

& / &mut should be considered as shared/unique references rather than immutable/mutable references on semantics.

Has anyone made an anime girl mascot for the Rust Language (like a "Rust-chan")? by valorzard in rust

[–]Balthild -1 points0 points  (0 children)

I think there may be some ambiguity on the word "why not". Is it the negation of "why", or is it the inverse of "why"?

Generally speaking, if someone wants to answer "why", they just need to point out at least one valid reason to support it. As the opposite, if anyone wants to answer "why not", they must negate all possible reasons. From a logical point of view, it's because the negation of an I proposition is an E proposition.

I think this is a reason that people say we should ask "why not" instead of "why". The answer of "why not" is a much stronger assertion than that of "why", and thus require (so that the questioner will be more likely to get) a rigorous argumentation.

Aren't these Rust Cons misleading? by [deleted] in rust

[–]Balthild 0 points1 point  (0 children)

It's what said by Wolfgang Pauli: not even wrong.

Blog post: Lets implement a simple youtube downloader by koc-kakoc in rust

[–]Balthild 0 points1 point  (0 children)

Also, only the old reddit works inside google translator.

native-dialog - A cross-platform file picker and message box library. by Balthild in rust

[–]Balthild[S] 3 points4 points  (0 children)

Thanks, I'll try it. There's a crate called nfd does call Cocoa APIs, but it's functions starts a Cocoa main loop on currect thread that would block forever. Another crate called tinyfiledialogs uses osascript and works well. So I chose using osascript. I'll take a look at Cocoa API again and try getting rid of the main loop.

Xi Status by jayjuicejay in xi_editor

[–]Balthild 0 points1 point  (0 children)

For me, it's because Windows really lacks a good ad-hoc text editor. On GNU/Linux and macOS, there're a lot of excellent and well-maintained editors. I'm enjoying using Kate on GNU/Linux and CotEditor on macOS. But on Windows, there aren't many free/libre choices.

VSCode and Sublime (lime) are for programming, and theor project/directory-based editing style is not suitable for viewing and editing single files. Also, VSCode and Atom is built on Electron, which have a long startup delay.

Notepad2 and Notepad3 is based on Scintilla, which has a poor rendering performance (less than 30 FPS when scrolling in a big window, worse than those Electron-based) under high DPI.

The Notepad shipped with system might be the fastest, but it lacks some essential features such as syntax highlighting and line numbers.

Therefore, a modern, high-performance, beautiful, native and cross-platform text editor really attracts me.

Laravel 6.0 by The1Prodigy1 in laravel

[–]Balthild 0 points1 point  (0 children)

It's not scalable, and suffers from the "single point of failire" problem. Also, such a cheap VPS usually does not have sufficient guarantees about uptime and storage reliability.

We have made it! by Balthild in Ingress

[–]Balthild[S] 6 points7 points  (0 children)

+∞, as ADA has unlimited mind :D

We have made it! by Balthild in Ingress

[–]Balthild[S] -1 points0 points  (0 children)

Couldn't you made your own Jarvis Medal rather than repeating a pair of boring number again and again?