Skip to content

config: support optional references; fix auto saving - #146

Merged
lotem merged 2 commits into
rime:masterfrom
kionz:config
Sep 7, 2017
Merged

lotem merged 2 commits into
rime:masterfrom
kionz:config

Conversation

@kionz

@kionz kionz commented Sep 6, 2017 •

Copy link
Copy Markdown
Contributor

(fixes #144)

@kionz kionz changed the title config: fix auto saving modifications; support optional references config: support optional references; fix auto saving (fixes #144) Sep 6, 2017
@kionz kionz changed the title config: support optional references; fix auto saving (fixes #144) config: support optional references; fix auto saving Sep 6, 2017
@osfans

osfans commented Sep 7, 2017

Copy link
Copy Markdown
Contributor

我這邊驗證沒有問題,可以生成了。只是有個編譯error,可能跟編譯參數有關。把問號放LOG裏面就好了。

index 675ed19..873124a 100644
--- a/src/rime/config/config_compiler.cc
+++ b/src/rime/config/config_compiler.cc
@@ -361,7 +361,7 @@ static an<ConfigItem> ResolveReference(ConfigCompiler* compiler,
     if (!resource->loaded) {
-      (reference.optional ? LOG(WARNING) : LOG(ERROR))
+      LOG(reference.optional ? WARNING : ERROR)
           << "resource could not be loaded: " << reference.resource_id;

@kionz

kionz commented Sep 7, 2017

Copy link
Copy Markdown
Contributor Author

嗯有空改改。我又想了想,可选加载的时候不需要报错。

@osfans

osfans commented Sep 7, 2017

Copy link
Copy Markdown
Contributor

或者默認都改成可選加載。加個+、!之類的,表示必須要加載,報錯。

@lotem

lotem commented Sep 7, 2017

Copy link
Copy Markdown
Member

我的意見是默認必須加載。
否則用家很容易因爲「用默認寫法」不加強制記號導致缺失資源而沒有檢查出來。
不過起初是想寫成這樣的:__include?: naive,現在覺得 __include: naive? 也不錯。

@lotem
lotem merged commit 14ec858 into rime:master Sep 7, 2017
@lotem lotem mentioned this pull request Sep 13, 2017
@kionz
kionz deleted the config branch September 20, 2017 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

user.yaml無法生成

3 participants