microsoft / microsoft/TypeScript-Sublime-Plugin

No way to retain user preferences on version update

Offen
#749 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
JavaScript
Sterne
1.7k
Forks
236
Ø Merge
21 T. 13 Std.
Gemergte PRs (30 T.)
1

Beschreibung

Hi there,

Thanks for creating this! It's been super helpful — I've been using this for more than a year now.

One thing I noticed is that this extension does not appear to conform to how Sublime structures extensions, as a result, every time a new version of this plugin is released, the plugin-wide settings will be deleted. The reason why is that there appears to be no way of setting a 'user' settings file for extension wide settings.

To illustrate, these are the options on my Sublime:

1 Preferences > Package Settings > Typescript > Plugin Settings — Default
Works

2 Preferences > Package Settings > Typescript > Plugin Settings — User
Does not exist, redirects to general user settings of the whole of Sublime text

3 Preferences > Package Settings > Typescript > Typescript Settings — Default
Works

4 Preferences > Package Settings > Typescript > Typescript Settings — User
Works

The #2 needs to exist so that the users have a place to save their own configuration that is retained across updates. This is not so simple as just creating the file, because the way the config files are named makes impossible for #2 to exist. Like this:

In a hypothetical Sublime extension called 'Acme', there are two config files:

1 One called Acme.sublime-settings and it lives in Packages/User. This is the user's own config file that persists between updates
2 One called Acme/Preferences.sublime-settings. This lives in Packages/Acme and this is the file that gets deleted and recreated when the extension updates

The issue with this package is that there are two config file sets — in the extension folder, there is both Typescript.sublime-settings and 'Preferences.sublime-settings. The former is the extension settings (let's say ExtConf) and the latter is the typescript settings (TSConf). The issue is that this doesn't work — ST will try to create a Typescript.sublime-settingsin the User folder to match thePreferences.sublime-settings` as the user version of the ExtConf, but that is the file that is being looked for the user version of the TSConf by the extension, and not for the user version of the ExtConf. This makes it so that it is impossible to retain user's own extension preferences for this extension across updates.

Here's one example of two-config-file setup that does it right:
https://github.com/victorporof/Sublime-HTMLPrettify

Hope this helps.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Dateien Typescript.sublime-settings und Preferences.sublime-settings der Erweiterung zu finden, und prüfe, wie Sublime-HTMLPrettify Erweiterungs- und Spracheinstellungen voneinander trennt. Stelle sicher, dass Benutzer über eine separate Einstellungsdatei für die Erweiterung verfügen, die über Updates hinweg erhalten bleibt, ohne die für TypeScript-Einstellungen verwendete Datei zu ändern; überprüfe, dass die beiden Einstellungseinträge unabhängig voneinander aufgelöst werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.