|
From: | Eric Ludlam |
Subject: | Re: IDE |
Date: | Mon, 19 Oct 2015 07:51:10 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 10/17/2015 10:25 AM, Dmitry Gutov wrote:
On 10/17/2015 03:45 PM, Eric Ludlam wrote:There is nothing about semantic the framework that prevents using something like SMIE as a tagging engine. It seems likely that if some language not supported by CEDET today has a good SMIE grammar, and if SMIE could be adapted to produce compatible tags (which isn't really that hard to do), and if SMIE has an entry point that allows parsing a tag set out of a region, then it would integrate into the semantic framework at the best level.With SMIE, though, it might make sense to optimize the process and only ask it for the current tag (and maybe the nearby ones), because it would otherwise be slower (no incremental parsing, or anything like that). So a straightforward conversion might not be optimal.But from the main examples you gave of tag usage, knowing the current tag is by far the most important.
There are many reasons why having all the tags in the current buffer is useful. The simplest of which are things like imenu - the menu part, speedbar, or ECB listings of all tags so you can jump to them. There is a command for jumping to a tag in a buffer by name with completion. There's an isearch flavor that searched only tag names in the current buffer.
Of course, the most important is that if you have all the detailed tags from a file that is closed, you don't need to open the file again if you need to reference it.
The mechanism in use is that there are detailed taggers, like those currently written for Semantic using wisent type parsers, and weak taggers, like GNU Global. Once a buffer is open, the detailed tagger runs and is truth. When a search occurs, a process of pulling all relevant databases together is started. This includes tags from the detailed taggers already cached, and high level 'omniscient' taggers that are usually weak, but have scanned the whole project.Well, that's my point: if you don't use etags, to have all project files indexed you have to open each of them at some point.
Sure - something does have to open them. If not emacs, then something will.
Some languages have import systems where you have to declare all file's dependencies at its top (and so you can know which files to reindex if you're only interested in this file; although even that could be a lot). But in Ruby and pre-ES6 JavaScript, you don't usually have that.
Using imports and includes, the semantic framework tracks what the dependencies are, and will reparse files that change outside of Emacs. It also will only open files listed as dependencies.
It will also, in idle time, pull in things it suspects you might want to open later, but that is to make visiting those things faster. It is easy to turn off, and we could turn it off by default if it is causing problems.
The key here is that the detailed tagger is needed to do complex tasks, but weak taggers are great to integrate in due to the speed advantage. Having a mix gives you the best possible results.If the program generating TAGS is smart enough, the result can be pretty accurate already (and contain qualified method name). Eli has recently made some improvements to that effect to etags.
If it can produce the needed data, then it would be simple enough to swap it in as an external parser. Since Emacs has full control over etags, it could be adapted to handle regions, and thus fit in just fine.
If instead you put the cursor on "tee" and do M-x semantic-ia-fast-jump RET it will go to the right spot.Indeed it does, thanks. But it goes to the second definition irrespective of which argument is passed to tee. Which brings us back to the completion problem I reported with that snippet.
You are right, I missed that. I've started a new test suite around this missing feature and will look into it.
For the keybinding you were using, the workflow is:Right, why doesn't semantic-ia-fast-jump have a default keybinding? I was only looking for the appropriate command in the active keymaps.
I've run out of steam trying to design the perfect set of keybindings. Everyone seems to like something different. ;)
C-c , J tee TAB shows you where it would jump, then TABOh, so it uses something more advanced than completing-read. That's unexpected.
Yes. I wrote my own so that the completion engine could weed out the maximum number of possible completions and speed up the process. Some of the tricks others have done that do take all possible completions in their UIs I think have obsoleted that advantage.
But also, I was looking for ways to allow selection of different methods of the same name that was easy and quick, and this is what I came up with.
Eric
[Prev in Thread] | Current Thread | [Next in Thread] |