diff --git a/lib/Perl/LanguageServer/Workspace.pm b/lib/Perl/LanguageServer/Workspace.pm index 9c35bca..cc9944a 100644 --- a/lib/Perl/LanguageServer/Workspace.pm +++ b/lib/Perl/LanguageServer/Workspace.pm @@ -8,6 +8,7 @@ use File::Basename ; use Coro ; use Coro::AIO ; use Data::Dump qw{dump} ; +use Fcntl qw(:DEFAULT :mode); with 'Perl::LanguageServer::SyntaxChecker' ; with 'Perl::LanguageServer::Parser' ; @@ -153,6 +154,14 @@ sub _build_state_dir $rootpath .= '/.vscode/perl-lang' ; print STDERR "state_dir = $rootpath\n" ; $self -> mkpath ($rootpath) ; + my $ignore = $rootpath . '/.gitignore' ; + aio_stat($ignore); + if (! -f _) + { + my $fh = aio_open($ignore, O_WRONLY | O_CREAT | O_EXCL, 0644); + aio_write($fh, undef, undef, "*\n", 0); + aio_close($fh); + } return $rootpath ; }