Giter Club home page Giter Club logo

Comments (9)

niosus avatar niosus commented on June 6, 2024 1

This should be fixed now. There are triggers in the package and it will not write anything to user preferences anymore.

from easyclangcomplete.

niosus avatar niosus commented on June 6, 2024

Yes, the HTML part comes already configured for sublime text. Basically, now it will write all the triggers it finds already defined to the user preferences.

I actually was thinking of putting the settings into the syntax specific files, but there are a couple downsides.

  • First: as you pointed out, it is harder to find
  • Second: to which of them? Currently the plugin works with C, C++, C Improved and C++11 syntaxes. Should I just put it into the one currently opened? That may cause confusion if the user uses multiple syntax definitions for different files (like .cpp uses one and .h the other). As a way to solve this to some degree, I could open the file that was edited by the plugin to show the user where the settings are. Also, I could add a context menu to open those files. But it still causes confusion. Maybe I could put the triggers to all syntax settings, I don't know.

So I would rather just put them into user settings actually. The problem here is that then the other triggers like html (I also have rust) appear. I cannot just remove them, because I don't know which ones of them come from the actual settings file. As an option, I could parse the settings file myself, but I also doesn't seem like the best solution ever.

I am open to any thoughts from your side and would love to make is intuitive for the user.

from easyclangcomplete.

simonhaenisch avatar simonhaenisch commented on June 6, 2024

Alright I get that, who knows how many other C/C++ plugins there are/will be with custom syntax. So syntax specific files aren't really an option. Parsing the settings file doesn't sound like a good plan either.

Isn't it possible to let the plugin set the triggers? I thought that ST parses settings in the order default -> plugins -> user. Then the triggers would be set without the need to configure anything, but a user could still overwrite them in his user or syntax specific settings.

from easyclangcomplete.

niosus avatar niosus commented on June 6, 2024

Oh, that is actually a very good though and I haven't thought about it before! It seems like this is a nice solution. I have to check if this actually works, but if it does, this is the best method.

from easyclangcomplete.

simonhaenisch avatar simonhaenisch commented on June 6, 2024

http://docs.sublimetext.info/en/latest/extensibility/packages.html#merging-and-order-of-precedence

I saw this a while ago, but I didn't really look into it... not sure about what this has to do with settings

from easyclangcomplete.

simonhaenisch avatar simonhaenisch commented on June 6, 2024

Here we go for settings:

http://docs.sublimetext.info/en/latest/customization/settings.html#order-of-precedence-of-sublime-settings-files

from easyclangcomplete.

simonhaenisch avatar simonhaenisch commented on June 6, 2024

So you can create a Preferences.sublime-settings file in Packages/EasyClangComplete and it will be merged into the default prefs, and then the user prefs file will be merged after that. Sounds like it is the way to go.

also see http://docs.sublimetext.info/en/latest/customization/settings.html#the-settings-hierarchy

from easyclangcomplete.

niosus avatar niosus commented on June 6, 2024

This actually looks pretty good and easy to try. Will do today.

from easyclangcomplete.

niosus avatar niosus commented on June 6, 2024

Ok, it works as expected, big thanks!
I will remove the dialog then as it is really not needed. I will also add an option to call with Ctrl + Shift + P to open the Preferences.sublime-settings file if anyone would want to edit these settings. + Documentation of course.

from easyclangcomplete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.