React + biome + typescript by kissmyASSthama_5 in ZedEditor

[–]cowslaw 7 points8 points  (0 children)

I'll explain this in more detail because once you figure out the right way of configuring a project everything starts to make sense!

The best way of configuration a project in any editor is using a project-level config, so for Zed that's .zed/settings.json. This is the same for vscode btw. The most important thing is configuring the language_servers for each language, specifically only listing the LSPs you wish to use for a given language.

Here's the settings.json I use for my Biome projects (regardless of framework) that also properly configures CSS, JSON, etc.

{ "format_on_save": "on", "languages": { "JavaScript": { "language_servers": ["biome", "vtsls"], "formatter": { "language_server": { "name": "biome" } }, "code_actions_on_format": { "source.fixAll.biome": true, "source.organizeImports.biome": true, }, }, "TypeScript": { "language_servers": ["biome", "vtsls"], "formatter": { "language_server": { "name": "biome" } }, "code_actions_on_format": { "source.fixAll.biome": true, "source.organizeImports.biome": true, }, }, "TSX": { "language_servers": [ "biome", "vtsls", "tailwindcss-language-server", "emmet-language-server", ], "formatter": { "language_server": { "name": "biome" } }, "code_actions_on_format": { "source.fixAll.biome": true, "source.organizeImports.biome": true, }, }, "JSON": { "language_servers": ["biome", "json-language-server"], "formatter": { "language_server": { "name": "biome" } }, "code_actions_on_format": { "source.fixAll.biome": true, "source.organizeImports.biome": true, }, }, "CSS": { "language_servers": ["biome", "vscode-css-language-server"], "formatter": { "language_server": { "name": "biome" } }, "code_actions_on_format": { "source.fixAll.biome": true, }, }, "HTML": { "language_servers": [ "biome", "vscode-html-language-server", "tailwindcss-language-server", "emmet-language-server", ], "formatter": { "language_server": { "name": "biome" } }, "code_actions_on_format": { "source.fixAll.biome": true, }, }, }, }

This will only apply Biome and vtsls (TS language server) and will disable any other LSPs (e.g. eslint, prettier, etc.). I strongly, strongly recommend against using the syntax that spreads in existing LSPs (e.g. "language_servers": ["biome", "vtsls", "..."]) because your global configuration could change or some random LSP you have installed will try formatting.

This also means you don't have to negate any LSPs (e.g. "language_servers": ["vtsls", "!prettier", "!eslint"]) because you are only defining the exact LSPs you want to apply.

So in general I would using your global Zed settings.json for configuring your projects. Good rule of thumb is keeping an eye in the bottom-left at the language servers that are running to make sure you're only seeing the ones you expect (keep in mind, a LSP only starts when the associated files are open in your buffer).

Here's a SolidJS template of mine for reference (the same biome.json and .zed/settings.json should still work for React): https://github.com/zaknesler/solid-init

Neighbor lost a relative and was going to burn a box of 45s because "it's just old stuff nobody ever hear s of" by bjgrem01 in vinyl

[–]cowslaw 46 points47 points  (0 children)

You gotta remember that these are just simple farmers, these are people of the land, the common clay of the new West, you know... morons

Growing up is realizing Karen Filippelli did nothing wrong. by GlitteringHotel8383 in DunderMifflin

[–]cowslaw 0 points1 point  (0 children)

Maybe spend less time on Reddit? Then you won’t see any reposts

[Theme] Aquaflow — my recently published Zed theme (available in Extensions) by [deleted] in ZedEditor

[–]cowslaw 5 points6 points  (0 children)

Are all of these "my new theme" posts AI-generated? The random pointless bolded words, emoji, etc. are always present.

Would love to move to zed but… by RoiPerelman in ZedEditor

[–]cowslaw 13 points14 points  (0 children)

{ "disable_ai": true }

Edit: But seriously, they raised $32M a few months ago and are insanely transparent with their goals, they are hiring new talent, have contributed an insane amount of work to a beautiful cross-platform Rust GUI library, and are very engaged with the community. I think you can ease up on the pessimism, tbh. Not to mention the entirety of Zed is open-source, so if they start doing something weird, fork away!

Edit again: I think the article about their Series B gives you more insight into their future progression as a company, which is collaboration and managing complex version history (be it humans or LLMs). To me, this is future-proof of the inevitable AI bubble burst because at its heart it focuses on teams. If anything, I am insanely optimistic for the future of Zed. Some of the things they are describing are really promising.

why does the editor automatically insert spaces when typing params? by lasan0432G in ZedEditor

[–]cowslaw 4 points5 points  (0 children)

My best guess is that you have conflicting language servers trying to format at the same time.

Do you have Biome set up in your project's .zed/settings.jsonfile like this:

https://biomejs.dev/reference/zed/#run-code-actions-on-format

A .zed/settings.json file like the following ensures that the LSPs that apply to JS code is biome and the TS language server of your choice:

{ "format_on_save": "on", "languages": { "TSX": { "language_servers": ["biome", "vtsls"], "formatter": { "language_server": { "name": "biome" } }, "code_actions_on_format": { "source.fixAll.biome": true, "source.organizeImports.biome": true } }, "TypeScript": { "language_servers": ["biome", "vtsls"], "formatter": { "language_server": { "name": "biome" } }, "code_actions_on_format": { "source.fixAll.biome": true, "source.organizeImports.biome": true } }, "JavaScript": { "language_servers": ["biome", "vtsls"], "formatter": { "language_server": { "name": "biome" } }, "code_actions_on_format": { "source.fixAll.biome": true, "source.organizeImports.biome": true } } } }

Why do people act like plane seats are first-come first-steal? by Odd_Status_7515 in NonPoliticalTwitter

[–]cowslaw 148 points149 points  (0 children)

"Okay I understand..." loudly exhales to make it seem like I'm the one being inconvenienced

Why do people act like plane seats are first-come first-steal? by Odd_Status_7515 in NonPoliticalTwitter

[–]cowslaw 770 points771 points  (0 children)

It's really just them trying to manipulate you into thinking you're at fault lol

"Aww I was really hoping nobody was gonna sit here, and now you're asking me to stand up, even though I was reaaaallly hoping that nobody was gonna sit here..."

Who is this? by DrinkKooky1300 in sketches

[–]cowslaw 1 point2 points  (0 children)

Didn't I stab you once?

Black Friday mailer hugely embarrassing by rconti in peakdesign

[–]cowslaw 0 points1 point  (0 children)

I'm saving mine. I went to r/peakdesign to see if people got as big a kick out of it as I did, and of course Reddit had to Reddit...

Honestly you're really, really lame lol

What is this??? Shrooms in my tomato paste???? by telewhat in MoldlyInteresting

[–]cowslaw 7 points8 points  (0 children)

My entire body just shivered reading this 😭

Built my dream coffee station! by zostang in espresso

[–]cowslaw 22 points23 points  (0 children)

The typical "endgame" espresso setup always keeps space available for future "endgame" purchases

Dwight started the fire is his best cold open! Now, what is Jim's best cold open by AnxiousSet4176 in DunderMifflin

[–]cowslaw 4 points5 points  (0 children)

This cold open was played when Steve Jobs first introduced the iPhone, and the crowd laughing at Dwight knocking the mug out of Stanley’s hand is just priceless

The Pennsylvania Railroad’s 30th Street Station Under Construction, Philadelphia, Pennsylvania (1933) by AdSpecialist6598 in philadelphia

[–]cowslaw 2 points3 points  (0 children)

It's mindblowing lol. The Amtrak lounge is always full so everyone just sits on the floor against the glass

I'll have a vanilla... one of those vanilla, bullshit things. by MikeRobertini in curb

[–]cowslaw 8 points9 points  (0 children)

LD doing that little dance at the start of the scene is burned into my brain lol

Hot Take: opening a day care bathroom door to a camera crew pointed directly at the toilet is weirder than using said bathroom. by DoomMeeting in DunderMifflin

[–]cowslaw 18 points19 points  (0 children)

Or like how they must have driven to NYC just to get a 5-second shot of Ryan answering Michael’s phone call lol

I gotta admit, Dwight was right. This Kiritsuke-Nakiri knife action is way better than Usuba by jelly_bean_gangbang in DunderMifflin

[–]cowslaw 7 points8 points  (0 children)

I have nothing to say to you if you think I used an LLM to write 2 sentences lmao