All of lore.kernel.org
 help / color / mirror / Atom feed
* Linux kernel environment setup in VSCode
@ 2022-04-04 18:31 Jasper Surmont
  2022-04-08  2:53 ` Minh Dang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jasper Surmont @ 2022-04-04 18:31 UTC (permalink / raw)
  To: kernelnewbies

Hey,

I'm new to the Linux kernel development, and I wanted to set up a VSCode 
environment for navigating the code (I know, even though people tell me 
Vim is better but currently I'm really not comfortable with it yet).
My main goal is just navigating and understanding. I've been able to 
make a lot work, and using the C/C++ extension from Microsoft I have 
good IntelliSense.

However, some things are getting flagged by the extension as errors 
(which of course shouldn't, since I've been able to compile the kernel).
These are things like: identifiers being undefined (for example, in 
kernel/sched/cpudeadline.c u64 is undefined) and errors like: function 
returning array is not allowed (for example, in drivers/md/dm-zero.c on 
the bottom).
I'm wondering if I'm forgetting things such that all these things get 
resolved. Any tips are appreciated.


Thanks!


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux kernel environment setup in VSCode
  2022-04-04 18:31 Linux kernel environment setup in VSCode Jasper Surmont
@ 2022-04-08  2:53 ` Minh Dang
  2022-04-14 20:35 ` Pavel Skripkin
       [not found] ` <CGME20220425013611epcas1p429b2ec55ce20472304e4ce28b32e4381@epcas1p4.samsung.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Minh Dang @ 2022-04-08  2:53 UTC (permalink / raw)
  To: Jasper Surmont; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 360 bytes --]

Hi,

C/C++ IntelliSense in conjunction with Makefile Tools extension could
solve the problem
Indeed, any projects built with makefile (such as Linux kernel) should use
this combination in VSCode
Here is an introduction of Makefile Tools
https://devblogs.microsoft.com/cppblog/now-announcing-makefile-support-in-visual-studio-code/

I hope it helps

Best,
Dang

[-- Attachment #1.2: Type: text/html, Size: 1210 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux kernel environment setup in VSCode
  2022-04-04 18:31 Linux kernel environment setup in VSCode Jasper Surmont
  2022-04-08  2:53 ` Minh Dang
@ 2022-04-14 20:35 ` Pavel Skripkin
       [not found] ` <CGME20220425013611epcas1p429b2ec55ce20472304e4ce28b32e4381@epcas1p4.samsung.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Pavel Skripkin @ 2022-04-14 20:35 UTC (permalink / raw)
  To: Jasper Surmont, kernelnewbies

Hi Jasper,

On 4/4/22 21:31, Jasper Surmont wrote:
> Hey,
> 
> I'm new to the Linux kernel development, and I wanted to set up a VSCode
> environment for navigating the code (I know, even though people tell me
> Vim is better but currently I'm really not comfortable with it yet).
> My main goal is just navigating and understanding. I've been able to
> make a lot work, and using the C/C++ extension from Microsoft I have
> good IntelliSense.
> 

Just don't install stock C/C++ extension. This extension can't handle 
the kernel, so every time you press 'go to definition' button you will 
get "hey, there are 20 references, one of them is 100% definition, so go 
ahead and find it yourself".

That's why I moved to vim + ctags. It saves my time a lot.

I saw, that there are other c extensions and people say they are a way 
better, but I didn't give them a try


Good luck!


With regards,
Pavel Skripkin

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux kernel environment setup in VSCode
       [not found] ` <CGME20220425013611epcas1p429b2ec55ce20472304e4ce28b32e4381@epcas1p4.samsung.com>
@ 2022-04-25  1:36   ` Kwanghoon Son
  0 siblings, 0 replies; 4+ messages in thread
From: Kwanghoon Son @ 2022-04-25  1:36 UTC (permalink / raw)
  To: Jasper Surmont; +Cc: kernelnewbies

[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]

On Mon, Apr 04, 2022 at 09:31:46PM +0300, Jasper Surmont wrote:
> Hey,
> 
> I'm new to the Linux kernel development, and I wanted to set up a VSCode
> environment for navigating the code (I know, even though people tell me Vim
> is better but currently I'm really not comfortable with it yet).
> My main goal is just navigating and understanding. I've been able to make a
> lot work, and using the C/C++ extension from Microsoft I have good
> IntelliSense.
> 
> However, some things are getting flagged by the extension as errors (which
> of course shouldn't, since I've been able to compile the kernel).
> These are things like: identifiers being undefined (for example, in
> kernel/sched/cpudeadline.c u64 is undefined) and errors like: function
> returning array is not allowed (for example, in drivers/md/dm-zero.c on the
> bottom).
vscode use clang and needs clangd.
you can generate from ./scripts/clang-tools/gen_compile_commands.py
which makes you navigate source code!
> I'm wondering if I'm forgetting things such that all these things get
> resolved. Any tips are appreciated.
> 
> 
> Thanks!
> 
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-01  0:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04 18:31 Linux kernel environment setup in VSCode Jasper Surmont
2022-04-08  2:53 ` Minh Dang
2022-04-14 20:35 ` Pavel Skripkin
     [not found] ` <CGME20220425013611epcas1p429b2ec55ce20472304e4ce28b32e4381@epcas1p4.samsung.com>
2022-04-25  1:36   ` Kwanghoon Son

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.