Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Upgrade Serde to 1.0 #300

Merged
merged 1 commit into from
May 10, 2017
Merged

Upgrade Serde to 1.0 #300

merged 1 commit into from
May 10, 2017

Conversation

tetsuharuohzeki
Copy link
Contributor

This change includes to upgrade languageserver-types.
It also contains to bump up the Language Server Potocol which our used to v3.

Related Issues

Cargo.toml Outdated
rls-analysis = "0.2.1"
rls-data = "0.3.1"
rls-span = { version = "0.4", features = ["serialize-serde"] }
rls-vfs = { git = "https://github.com/nrc/rls-vfs", rev = "ab5eaf3ed62fe6c5e8d2eab5afdf0a511dd51cd9", features = ["racer-impls"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rls-vfs containing rust-dev-tools/rls-vfs#17 has not been published yet. So I specified git rev. directly.

@nrc could you publish the new version fo rls-vfs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I published v0.3 with these changes

@nrc
Copy link
Member

nrc commented May 8, 2017

Seems to be causing some test failure. Let me know if you want help debugging.

@tetsuharuohzeki
Copy link
Contributor Author

The result of TravisCI (linux)


running 10 tests

test build::test::test_dedup_flags ... ok

test test::test_parse_error_on_malformed_input ... ok

test test::test_borrow_error ... ok

test test::test_find_all_refs ... FAILED

test test::test_goto_def ... ok

test test::test_hover ... FAILED

test test::test_highlight ... FAILED

test test::test_find_all_refs_no_cfg_test ... FAILED

test test::test_rename ... FAILED

test test::test_completion ... ok

failures:

---- test::test_find_all_refs stdout ----

expect_messages: results: ["{\"jsonrpc\":\"2.0\",\"id\":0,\"result\":{\"capabilities\":{\"textDocumentSync\":2,\"hoverProvider\":true,\"completionProvider\":{\"resolveProvider\":true,\"triggerCharacters\":[\".\",\":\"]},\"signatureHelpProvider\":{\"triggerCharacters\":[]},\"definitionProvider\":true,\"referencesProvider\":true,\"documentHighlightProvider\":true,\"documentSymbolProvider\":true,\"workspaceSymbolProvider\":true,\"codeActionProvider\":false,\"documentFormattingProvider\":false,\"documentRangeFormattingProvider\":false,\"renameProvider\":false}}}", "{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsBegin\",\"params\":null}", "{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsEnd\",\"params\":null}"],

expected: [ExpectedMessage { id: Some(0), contains: ["capabilities"] }, ExpectedMessage { id: None, contains: ["diagnosticsBegin"] }, ExpectedMessage { id: None, contains: ["diagnosticsEnd"] }]

expect_messages: results: ["{"jsonrpc":"2.0","id":42,"result":[]}"],

expected: [ExpectedMessage { id: Some(42), contains: ["{"start":{"line":9,"character":7},"end":{"line":9,"character":10}}", "{"start":{"line":15,"character":14},"end":{"line":15,"character":17}}", "{"start":{"line":23,"character":15},"end":{"line":23,"character":18}}"] }]

thread 'test::test_find_all_refs' panicked at 'Could not find {"start":{"line":9,"character":7},"end":{"line":9,"character":10}} in {"jsonrpc":"2.0","id":42,"result":[]}', /checkout/src/libcore/option.rs:794

---- test::test_hover stdout ----

expect_messages: results: ["{\"jsonrpc\":\"2.0\",\"id\":42,\"result\":{\"capabilities\":{\"textDocumentSync\":2,\"hoverProvider\":true,\"completionProvider\":{\"resolveProvider\":true,\"triggerCharacters\":[\".\",\":\"]},\"signatureHelpProvider\":{\"triggerCharacters\":[]},\"definitionProvider\":true,\"referencesProvider\":true,\"documentHighlightProvider\":true,\"documentSymbolProvider\":true,\"workspaceSymbolProvider\":true,\"codeActionProvider\":false,\"documentFormattingProvider\":false,\"documentRangeFormattingProvider\":false,\"renameProvider\":false}}}", "{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsBegin\",\"params\":null}", "{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsEnd\",\"params\":null}"],

expected: [ExpectedMessage { id: Some(42), contains: ["capabilities"] }, ExpectedMessage { id: None, contains: ["diagnosticsBegin"] }, ExpectedMessage { id: None, contains: ["diagnosticsEnd"] }]

expect_messages: results: ["{"jsonrpc":"2.0","id":42,"result":{"contents":[],"range":null}}"],

expected: [ExpectedMessage { id: Some(42), contains: ["[{"language":"rust","value":"&str"}]"] }]

thread 'test::test_hover' panicked at 'Could not find [{"language":"rust","value":"&str"}] in {"jsonrpc":"2.0","id":42,"result":{"contents":[],"range":null}}', /checkout/src/libcore/option.rs:794

---- test::test_highlight stdout ----

expect_messages: results: ["{\"jsonrpc\":\"2.0\",\"id\":0,\"result\":{\"capabilities\":{\"textDocumentSync\":2,\"hoverProvider\":true,\"completionProvider\":{\"resolveProvider\":true,\"triggerCharacters\":[\".\",\":\"]},\"signatureHelpProvider\":{\"triggerCharacters\":[]},\"definitionProvider\":true,\"referencesProvider\":true,\"documentHighlightProvider\":true,\"documentSymbolProvider\":true,\"workspaceSymbolProvider\":true,\"codeActionProvider\":false,\"documentFormattingProvider\":false,\"documentRangeFormattingProvider\":false,\"renameProvider\":false}}}", "{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsBegin\",\"params\":null}", "{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsEnd\",\"params\":null}"],

expected: [ExpectedMessage { id: Some(0), contains: ["capabilities"] }, ExpectedMessage { id: None, contains: ["diagnosticsBegin"] }, ExpectedMessage { id: None, contains: ["diagnosticsEnd"] }]

expect_messages: results: ["{"jsonrpc":"2.0","id":42,"result":[]}"],

expected: [ExpectedMessage { id: Some(42), contains: ["{"start":{"line":20,"character":8},"end":{"line":20,"character":13}}", "{"start":{"line":21,"character":27},"end":{"line":21,"character":32}}"] }]

thread 'test::test_highlight' panicked at 'Could not find {"start":{"line":20,"character":8},"end":{"line":20,"character":13}} in {"jsonrpc":"2.0","id":42,"result":[]}', /checkout/src/libcore/option.rs:794

---- test::test_find_all_refs_no_cfg_test stdout ----

expect_messages: results: ["{\"jsonrpc\":\"2.0\",\"id\":0,\"result\":{\"capabilities\":{\"textDocumentSync\":2,\"hoverProvider\":true,\"completionProvider\":{\"resolveProvider\":true,\"triggerCharacters\":[\".\",\":\"]},\"signatureHelpProvider\":{\"triggerCharacters\":[]},\"definitionProvider\":true,\"referencesProvider\":true,\"documentHighlightProvider\":true,\"documentSymbolProvider\":true,\"workspaceSymbolProvider\":true,\"codeActionProvider\":false,\"documentFormattingProvider\":false,\"documentRangeFormattingProvider\":false,\"renameProvider\":false}}}", "{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsBegin\",\"params\":null}", "{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsEnd\",\"params\":null}"],

expected: [ExpectedMessage { id: Some(0), contains: ["capabilities"] }, ExpectedMessage { id: None, contains: ["diagnosticsBegin"] }, ExpectedMessage { id: None, contains: ["diagnosticsEnd"] }]

expect_messages: results: ["{"jsonrpc":"2.0","id":42,"result":[]}"],

expected: [ExpectedMessage { id: Some(42), contains: ["{"start":{"line":9,"character":7},"end":{"line":9,"character":10}}", "{"start":{"line":23,"character":15},"end":{"line":23,"character":18}}"] }]

thread 'test::test_find_all_refs_no_cfg_test' panicked at 'Could not find {"start":{"line":9,"character":7},"end":{"line":9,"character":10}} in {"jsonrpc":"2.0","id":42,"result":[]}', /checkout/src/libcore/option.rs:794

---- test::test_rename stdout ----

expect_messages: results: ["{\"jsonrpc\":\"2.0\",\"id\":0,\"result\":{\"capabilities\":{\"textDocumentSync\":2,\"hoverProvider\":true,\"completionProvider\":{\"resolveProvider\":true,\"triggerCharacters\":[\".\",\":\"]},\"signatureHelpProvider\":{\"triggerCharacters\":[]},\"definitionProvider\":true,\"referencesProvider\":true,\"documentHighlightProvider\":true,\"documentSymbolProvider\":true,\"workspaceSymbolProvider\":true,\"codeActionProvider\":false,\"documentFormattingProvider\":true,\"documentRangeFormattingProvider\":true,\"renameProvider\":true}}}", "{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsBegin\",\"params\":null}", "{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsEnd\",\"params\":null}"],

expected: [ExpectedMessage { id: Some(0), contains: ["capabilities"] }, ExpectedMessage { id: None, contains: ["diagnosticsBegin"] }, ExpectedMessage { id: None, contains: ["diagnosticsEnd"] }]

expect_messages: results: ["{"jsonrpc":"2.0","id":42,"result":{"changes":{}}}"],

expected: [ExpectedMessage { id: Some(42), contains: ["{"start":{"line":20,"character":8},"end":{"line":20,"character":13}}", "{"start":{"line":21,"character":27},"end":{"line":21,"character":32}}", "{"changes""] }]

thread 'test::test_rename' panicked at 'Could not find {"start":{"line":20,"character":8},"end":{"line":20,"character":13}} in {"jsonrpc":"2.0","id":42,"result":{"changes":{}}}', /checkout/src/libcore/option.rs:794

failures:

test::test_find_all_refs

test::test_find_all_refs_no_cfg_test

test::test_highlight

test::test_hover

test::test_rename

test result: FAILED. 5 passed; 5 failed; 0 ignored; 0 measured

@tetsuharuohzeki
Copy link
Contributor Author

@nrc I'm trying debugging failures. I feel these.

  • By results, I feel that the failures does not have results. They are empty.
  • For example, I'm inspecting test::test_hover():

env RUST_LOG=trace cargo test hover show the following:

TRACE:rls::server: Handling Hover (42) (params: TextDocumentPositionParams { text_document: TextDocumentIdentifier { uri: "file:///Users/tetsuharu/src/rust/rls/test_data/hover/src/main.rs" }, position: Position { line: 21, character: 27 } }
TRACE:rls::actions: convert_pos_to_span: "/Users/tetsuharu/src/rust/rls/test_data/hover/src/main.rs" Position { line: 21, character: 27 }
TRACE:rls::actions: line: `    println!("Hello, {}!", world);
`
TRACE:rls::actions: start: 27
TRACE:rls::actions: end: 32
TRACE:rls::actions: hover: Span { file: "/Users/tetsuharu/src/rust/rls/test_data/hover/src/main.rs", range: Range { row_start: Row(21, PhantomData), row_end: Row(21, PhantomData), col_start: Column(27, PhantomData), col_end: Column(32, PhantomData) } }

However, these values shows the empty string if I insert the trace macro (e.g. trace!("ty: {:?}", ty) to there.

How do you think about these results?


my environment is:

  • macOS Sierra 10.12.4
  • rustc 1.19.0-nightly (f420965 2017-05-05)
  • cargo 0.19.0-nightly (fa7584c14 2017-04-26)

@nrc
Copy link
Member

nrc commented May 8, 2017

Such empty sets usually mean a mismatch in the analysis info somewhere, such as a bad span. In this case it might be something else, not exactly sure what. I'm about to step into a meeting but I'll investigate afterwards.

@nrc nrc mentioned this pull request May 8, 2017
@nrc
Copy link
Member

nrc commented May 8, 2017

I'm investigating the test failure here. I can reproduce, and when doing so it seems that no save-analysis data is being produced, but we're not using the in-memory form of save-analysis either. I have no idea what is going on. Continuing...

@nrc
Copy link
Member

nrc commented May 8, 2017

So, it looks like we need rust-lang/rust#41833 to land before this will work. AFAICT, the trouble is that the analysis struct is not the same version from the compiler and in rls-analysis. For some reason this ends up with None, rather than Some(BAD_STUFF). We'll have to wait for that PR to land and hit nightly and then re-test this PR.

@tetsuharuohzeki
Copy link
Contributor Author

@nrc

okay. thank you for your help.

This change includes to upgrade [languageserver-types](https://github.com/gluon-lang/languageserver-types).
It also contains to bump up the Language Server Potocol which our used to v3.
@tetsuharuohzeki
Copy link
Contributor Author

@tetsuharuohzeki
Copy link
Contributor Author

@nrc r?

@nrc
Copy link
Member

nrc commented May 10, 2017

Verified, merging. Thanks for your patience!

@nrc nrc merged commit 207c18d into rust-lang:master May 10, 2017
@tetsuharuohzeki tetsuharuohzeki deleted the serde branch May 10, 2017 22:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants