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

config: support optional references; fix auto saving #146

Merged
merged 2 commits into from
Sep 7, 2017
Merged

config: support optional references; fix auto saving #146

merged 2 commits into from
Sep 7, 2017

Conversation

kionz
Copy link
Contributor

@kionz kionz commented Sep 6, 2017

(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
Copy link
Contributor

osfans commented Sep 7, 2017

我這邊驗證沒有問題,可以生成了。只是有個編譯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
Copy link
Contributor Author

kionz commented Sep 7, 2017

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

@osfans
Copy link
Contributor

osfans commented Sep 7, 2017

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

@lotem
Copy link
Member

lotem commented Sep 7, 2017

我的意見是默認必須加載。
否則用家很容易因爲「用默認寫法」不加強制記號導致缺失資源而沒有檢查出來。
不過起初是想寫成這樣的:__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