intellij-rust / intellij-rust

Rust plugin for the IntelliJ Platform
https://intellij-rust.github.io
MIT License
4.54k stars 380 forks source link

How to disable "smart" quotes and "smart" bracket completion in strings #9916

Open wcarmon opened 1 year ago

wcarmon commented 1 year ago

Environment

Problem description

  1. How do we disable smart quotes?
  2. How do we disable the automatic # for raw strings (Why? the plugin keeps putting them in the wrong place)
  3. How do we disable the pair brace features (Why? conflicts with my muscle memory so costs more keystrokes to delete extra braces)

Intellij, Goland and CLion all seem so have "checkboxes" to disable, but they only work for Java, Go and C++, not Rust

See https://www.jetbrains.com/help/idea/settings-smart-keys.html

Steps to reproduce

  1. open clion or goland, disable the setting for smart quotes and brace pairs
  2. Open a rust file
  3. Add a string to some fn, eg. let s = format!(r#")
  4. the IDE should NOT help you complete the quotes
  5. Add another string to some fn eg. write!(w, "aaa "" aaa") // yes this is broken
  6. try to fix it by adding r# before the string
  7. the IDE should NOT help you, it should NOT put a second # into the string
  8. (Similar for pair braces)
mili-l commented 1 year ago

https://user-images.githubusercontent.com/1213122/209778413-8ec0da42-c707-4f81-ac3a-8fe1fed80395.mov

afetisov commented 1 year ago

1, 3: the usual IDE "Insert paired brackets"/"Insert paired quotes" settings work for me. If they fail to work for you, I'd like to see a complete reproducing example. The one at the bottom of your post worked as expected for me.

2: Yeah, there doesn't seem to be a way to disable that one. I think we should have a separate Rust-specific option for that feature.