[llvm-bugs] [Bug 41906] New: clangd supports .cl files but not .ocl

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 16 06:38:40 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41906

            Bug ID: 41906
           Summary: clangd supports .cl files but not .ocl
           Product: clang-tools-extra
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: clangd
          Assignee: unassignedclangbugs at nondot.org
          Reporter: paul.marechal at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 21953
  --> https://bugs.llvm.org/attachment.cgi?id=21953&action=edit
bogus file

I am trying to send OpenCL files to clangd, as it seems that it is able to
provide useful diagnostics and information for .cl files.

OpenCL source files can also end with .ocl, but in this case clangd seems to be
failing in some way.

Here is what is roughly sent to clangd:

> Sending notification 'textDocument/didOpen'.
> Params: {
>     "textDocument": {
>         "uri": "file:///home/me/tests/opencl-theia-test/hello.ocl",
>         "languageId": "cpp",
>         "version": 1,
>         "text": "\n__kernel int test() {\n    return 1;\n}\n\n__kernel void HelloWorld() {\n    int a = test();\n}\n"
>     }
> }

If the file ends with .ocl, when I hover a symbol I get:

> Sending request 'textDocument/hover - (23)'.
> Params: {
>     "textDocument": {
>         "uri": "file:///home/me/tests/opencl-theia-test/hello.ocl"
>     },
>     "position": {
>         "line": 5,
>         "character": 16
>     }
> }
> Received response 'textDocument/hover - (23)' in 92ms. Request failed: invalid AST (-32001).

I get the same error with `Go To Definition`.

However, if the file ends with .cl, everything works.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190516/0a2310ef/attachment-0001.html>


More information about the llvm-bugs mailing list