microsoft / microsoft/TypeScript-Sublime-Plugin

No way to retain user preferences on version update

オープン
#749 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
1.7k
フォーク
236
平均マージ
21日 13時間
マージ済み PR(30日)
1

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず拡張機能の Typescript.sublime-settings ファイルと Preferences.sublime-settings ファイルを見つけ、Sublime-HTMLPrettify が拡張機能の設定と言語設定をどのように分離しているかを確認します。ユーザーが、TypeScript の設定に使用されるファイルを変更せずに、更新後も保持される拡張機能用の個別の設定ファイルを使用できるようにします。2 つの設定エントリがそれぞれ独立して解決されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。