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: unassignedclangb...@nondot.org
          Reporter: paul.marec...@ericsson.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to