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

Restart clangd when changing build config, add UI test #2907

Closed
wants to merge 0 commits into from

Conversation

simark
Copy link
Contributor

@simark simark commented Sep 18, 2018

See individual patches for more details.

const cppRootDir = path.join(rootDir, 'cpp');

fs.mkdirSync(cppRootDir);
fs.writeFileSync(path.join(cppRootDir, 'paul.cpp'), `
Copy link
Member

Choose a reason for hiding this comment

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

How about source.cpp...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

clangd is hard-coded to only work with files called paul.cpp.

Copy link
Member

Choose a reason for hiding this comment

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

How convenient!

@paul-marechal
Copy link
Member

There seem to be an issue with the travis build, but it doesn't seem related to your changes at first glance.

@marcdumais-work
Copy link
Contributor

I can have a look at the UI test part.

@simark
Copy link
Contributor Author

simark commented Sep 19, 2018

I just rebased and replaced paul.cpp with a more boring name.

@akosyakov
Copy link
Member

akosyakov commented Sep 20, 2018

I think we want eventually to move optional language extensions to their own repositories, like java, cpp. I'm not sure that it is a good idea to couple UI tests in example packages with them. Maybe it is already better to have a dedicated repo for the end to end UI testing of the cpp integration.

// cc @svenefftinge

@svenefftinge
Copy link
Contributor

@akosyakov yes, we should extract them.
I will ask the foundation to create repos for cpp, python, java.
@simark would moving cpp work for you? We don't need to wait with this PR though. The test just need to move along.

@svenefftinge
Copy link
Contributor

I have created https://bugs.eclipse.org/bugs/show_bug.cgi?id=539262

@simark
Copy link
Contributor Author

simark commented Sep 20, 2018

@simark would moving cpp work for you? We don't need to wait with this PR though. The test just need to move along.

Yes, that was the intention, to split the cpp extension after the move to Eclipse. Including moving the UI test. And when we do that, I intend to remove the code that skips the test if clangd is not found (it will be a requirement for running the cpp tests).

But for these separate extensions to be able to have some UI tests, I think we'll need to have some library that provides these TopPanel, BottomPanel and other utilities. We don't want to re-implement them in every repo.

const out = cp.execSync('clangd -version', {encoding: 'utf8'});
// Match 'clangd version' at the start of
// 'clangd version 8.0.0 (trunk 341484) (llvm/trunk 341481)'.
return out.indexOf('clangd version') == 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

"===" instead of "=="?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indexOf can only return a number, so == is fine here. Otherwise, I think the linter would have told me.

*/
function hasClangd() {
try {
const out = cp.execSync('clangd -version', {encoding: 'utf8'});
Copy link
Contributor

@marcdumais-work marcdumais-work Sep 27, 2018

Choose a reason for hiding this comment

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

At least on my Ubuntu machine, installing clangd 8 from the LLVM PPA (package: clang-tools-8), I do not end-up with a "clangd" executable or symlink. Rather the name is "clangd-8", and so I think it will not be detected as installed, here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, for now it's necessary to create that link by hand, see:

https://github.com/theia-ide/theia/blob/master/packages/cpp/README.md

Eventually, it will be done automatically:

http://lists.llvm.org/pipermail/clangd-dev/2018-September/000138.html

@simark simark closed this Sep 28, 2018
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.

5 participants