Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ad-tag-include shows up in non-asciidoc files' auto complete #632

Open
dnbln opened this issue Jan 2, 2021 · 16 comments
Open

ad-tag-include shows up in non-asciidoc files' auto complete #632

dnbln opened this issue Jan 2, 2021 · 16 comments
Assignees
Labels

Comments

@dnbln
Copy link
Contributor

dnbln commented Jan 2, 2021

Observed vs. expected behavior

ad-tag-include shows up on auto complete everywhere, instead of only in asciidoc files.

Steps to reproduce

Type a in any open editor that is not an asciidoc file(a rust file in this image)
image

Environment

Plugin Version: 0.32.7
IntelliJ Details: CLion 2020.3.1
Build #CL-203.6682.181, built on December 30, 2020
Runtime version: 11.0.9.1+11-b1145.63 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.9.14-arch1-1
GC: ParNew, ConcurrentMarkSweep
Memory: 1987M
Cores: 4
Registry: run.processes.with.pty=TRUE, debugger.watches.in.variables=false, ide.tree.collapse.recursively=false, ide.balloon.shadow.size=0
Non-Bundled Plugins: GLSL, IdeaVIM, Key Promoter X, SmarterEditor, String Manipulation, com.alayouni.ansiHighlight, com.chrisrm.idea.MaterialThemeUI, com.fernandojimenez.obsidian.theme, com.intellij.copyright, com.intellij.ideolog, com.intellij.plugins.visualstudiokeymap, com.intellij.plugins.vscodekeymap, com.mallowigi, com.nasmlanguage, com.samdark.intellij-visual-studio-code-dark-plus, idea.goyacc, io.allandequeiroz.random.image.background, nb-mind-map-idea, net.seesharpsoft.intellij.plugins.file-preview, net.vektah.codeglance, org.editorconfig.editorconfigjetbrains, org.jetbrains.plugins.hocon, com.codestream.jetbrains-codestream, uk.co.ben-gibson.remote.repository.mapper, zielu.gittoolbox, com.almightyalpaca.intellij.plugins.discord, mobi.hsz.idea.gitignore, com.jetbrains.codeWithMe, name.kropp.intellij.makefile, Docker, org.toml.lang, tv.codely.codelytv-theme, org.exbin.deltahex.intellij, org.asciidoctor.intellij.asciidoc, org.rust.lang, com.github.ArtsiomCh.NestedBracketsColorer, com.mdrobnak.intellij-lalrpop, ru.adelf.idea.dotenv
Current Desktop: GNOME

Possible fix?

Change this line to

<option name="AsciiDoc" value="true" />

Or at least add an option to disable it?

@dnbln dnbln added the bug label Jan 2, 2021
@ahus1
Copy link
Contributor

ahus1 commented Jan 3, 2021

Thanks for reporting this accurately will all necessary details. Yes, the fix you suggest should fix it. Do you want to provide a pull request?

@dnbln
Copy link
Contributor Author

dnbln commented Jan 3, 2021

Looking at #450 (comment) this might have been intended?

@ahus1
Copy link
Contributor

ahus1 commented Jan 3, 2021

Hm, you're right. Thanks for doing the research. So it makes sense to keep it for all languages, as includes would work in all languages.

Could this be better clarified to avoid surprises in the future?

@mojavelinux
Copy link
Member

mojavelinux commented Jan 3, 2021 via email

@ahus1
Copy link
Contributor

ahus1 commented Jan 3, 2021

@mojavelinux - my last comment was not as precise as it could have been: it is about adding tags to source code files of other languages that will then be used as tags for includes in AsciiDoc.

The following recoding shows how it works inpractice. The hot-key is Ctrl+Alt+T. It adds line comments (for example // or # depending on the language of the file.

tag-for-include

@dnbln
Copy link
Contributor Author

dnbln commented Jan 3, 2021

Finally found how to disable it(Settings > Editor > Live templates). While it's without a doubt useful, my question now is should it really be opt-out of rather than opt-in?

@mojavelinux
Copy link
Member

@ahus1 Thanks for clarifying and my apologies for the confusion. That makes perfect sense.

@ahus1
Copy link
Contributor

ahus1 commented Jan 3, 2021

@dblanovschi - I assume that this feature would be hard to discover for users it it would be opt-in. Having it as a live template to create an empty tagged snipped to be included and as a surround-with... is helpful for those who want to include source code snippets in their AsciiDoc documents.

I'll update the description "Surround with Tag for include macro" to make it more descriptive.

I recommend that you disable it as you described above if you think you'll not going to use it.

@dnbln
Copy link
Contributor Author

dnbln commented Jan 3, 2021

Ok, thank you

@ahus1
Copy link
Contributor

ahus1 commented Jan 4, 2021

Updated description of live template. Update docs in dc7842c for Live Templates; also added entry to FAQ.

@markushaslinger
Copy link

Since a couple of days typing a and then a space (not tab!) triggers the template. Given that 'a' is quite common in English that really hurts.

adoc_plugin_issue

I'm not sure if that was a change in the plugin, something JB did or if I messed up a setting.
@ahus1 I suppose that is not expected behaviour - any ideas?

@bric3
Copy link
Contributor

bric3 commented Jan 17, 2024

Yeah it's super annoying (same as @markushaslinger). I don't think the tag include should be live template either, I'd rather have this as an intention action.

For me it shows everywhere I type english text, e.g. in github PR review comment component :

image

@ahus1 I would really revisit this ! E.g. IJ also has surround actions, and now they appear in their editor floating bar which might be a better fit.

@bric3
Copy link
Contributor

bric3 commented Jan 17, 2024

Also strangely this live template appear when nothing is selected, which should at least be the spirit

image

@ahus1 ahus1 reopened this Jan 18, 2024
@ahus1
Copy link
Contributor

ahus1 commented Jan 18, 2024

I did another search, and there is this usability issue in tracked for IntelliJ: https://youtrack.jetbrains.com/issue/IDEABKL-7114

They describe how to disable live templates to show up in the auto-completion by changing the registry entry show.live.templates.in.completion. Once you disabled them, there is still the hotkey Ctrl+J (Windows) to trigger them when you need them.

I'm having another look if this can be suppressed somehow in a more standard way.

@ahus1 ahus1 self-assigned this Jan 18, 2024
@ahus1
Copy link
Contributor

ahus1 commented Jan 18, 2024

Also strangely this live template appear when nothing is selected

@bric3 - the template still makes sense if you start with an include tag in a non-AsciiDoc file and then start typing the content between the start and end.

Again, I'll have another look how this can be changed in addition to the registry option stated above.

@bric3
Copy link
Contributor

bric3 commented Jan 18, 2024

They describe how to disable live templates to show up in the auto-completion

Yeah but I do like to have the other live template in the completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants