3 ms·
That's what I used to use as a human, but then I finally overcame my laziness in setting up integration between my editor and compiler (and similar) and got 'ju
by eru 1y ago
That's what I used to use as a human, but then I finally overcame my laziness in setting up integration between my editor and compiler (and similar) and got 'jump to definition' working.
(Well, I didn't overcome my laziness directly. I just switched from being lazy and not setting up vim and Emacs with the integrations, to trying out vscode where this was trivial or already built in.)
- lukaslalinsky 1y agoDo you trust 'jump to definition'. Obviously it depends on the language server, but it's best effort. I'm often frustrated when it doesn't work, because I broke the code in some way. Or it jumps to a specific definition, but there are multiple. If I was as quick at opening and reading files as claude code, I'd prefer grep with context around the searched term.
- eru 1y ago> Do you trust 'jump to definition'. It depends, for some languages 'jump to definition' tools ask the same compiler/interpreter that you use to build your code, so it's as accurate as it gets, and it's not 'best effort'. It also depends a bit on your project, some project are more prone to re-using names or symbols. > If I was as quick at opening and reading files as claude code, I'd prefer grep with context around the searched term. Well, Claude probably also doesn't want to have to 'learn' how to use all kinds of different tools for different languages and eco-systems.
- guipsp 1y agoIn java, for example, jump to definition is pretty flawless.
- robmccoll 1y agoUnless I'm in an interface and inheritance heavy codebase. Then the first place it jumps to is rarely the one I wanted.
- codyb 1y agoIn ViM with the CoC code completion plugin JTD gives me multiple options when there are many and I can choose the sensible one in a popover before the actual jump occurs. I believe that was my experience with IDEs too?
- 1718627440 1y agoYou can instruct the compiler to tell you, for example by passing -save-temps, and then it's a trivial text search in a single file.
- codyb 1y agoJump to definition works when you have the starting point already. I use both grep and JTD fairly frequently for different use cases.
- eru 1y agoYes. I meant 'Jump to Definition' as one clear example, not as a definitive enumeration of everything that compiler integration can help you with. Eg compiler integration is also really useful to show you the inferred types. Even dinosaurs like old-school Java and C have (limited) type inference: inside of expressions. But of course in a language like Haskell or Rust (or even Python) this becomes much more important.