You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use copilot with blink using blink-cmp-copilot and copilot.lua but I got segmentation fault when accepting specific completion
the file I use that consistently result segmentation fault is this one
import{Initializer,Inject,Service}from'fastify-decorators';import{Brackets,FindOptionsWhere,Repository}from'typeorm';import{PostgreSQLConnection}from'../../../data/connection/postgresql.connection';import{BaseSQLDAO}from'../../common/common.repository';import{EntityCategory}from'../../../data/entities/pgsql/EntityCategory.entity';import{RequestUser}from'../../libs/types';import{ERR_BAD_REQUEST,ERR_INTERNAL_SERVER}from'../../libs/constants/errors';import{uuidRegex}from'../../libs/constants/regexp';import{// prettier-ignoreEntityCategoryMapping,}from'../../../data/entities/pgsql/mapping/EntityCategoryMapping.entity';import{EntityCategoryPaginationParamsDTO}from'./entityCategory.dto';import{clamp}from'../../libs/utils/helpers';
@Service()exportclassEntityCategoryRepositoryextendsBaseSQLDAO<EntityCategory>{
@Inject(PostgreSQLConnection)protectedpsql: PostgreSQLConnection;protectedrepository: Repository<EntityCategory>;protectedcategoryMapRepository: Repository<EntityCategoryMapping>;
@Initializer([PostgreSQLConnection])asyncinit(): Promise<void>{this.repository=this.psql.connection.getRepository(EntityCategory);this.categoryMapRepository=this.psql.connection.getRepository(EntityCategoryMapping);}asyncgetWithIdOrName(id: string): Promise<EntityCategory|null>{try{constwhere: FindOptionsWhere<EntityCategory>[]=[{name: id},];if(uuidRegex.test(id)){where.push({ id });}returnthis.repository.findOne({ where });}catch(error){if(!error.code){throwERR_INTERNAL_SERVER(`Get entity category with id or name error: ${error.message}`);}throwerror;}}asynctagCategory(id: string,parentId: string,user: RequestUser,): Promise<EntityCategoryMapping>{try{constcategory=awaitthis.getWithIdOrName(id);if(!category){thrownewERR_BAD_REQUEST('Category not found');}constparentCategory=awaitthis.getWithIdOrName(parentId);if(!parentCategory){thrownewERR_BAD_REQUEST('Parent category not found');}constnow=newDate();consttoBeEntity:Partial<EntityCategoryMapping>={createdBy: user.id,createdAt: now,updatedBy: user.id,updatedAt: now,categoryId: category.id,parentCategoryId: parentCategory.id,};constentity=this.categoryMapRepository.create(toBeEntity);constcreatedEntity=awaitthis.categoryMapRepository.save(entity);returncreatedEntity;}catch(error){if(!error.code){throwERR_INTERNAL_SERVER(`Tag category error: ${error.message}`);}throwerror;}}asyncsearch(query: EntityCategoryPaginationParamsDTO,): Promise<[EntityCategory[],number,number]>{try{constlimit=clamp(query.$limit??10,1,1000);constskip=query.$page&&query.$page>1 ? (query.$page-1)*limit : 0;constdbQuery=this.repository.createQueryBuilder('category');dbQuery.leftJoin('category.categories','parent');if(query.name&&query.name.length>0){dbQuery.andWhere('category.name IN (:...name)',{name: query.name});}if(query.excludeId&&query.excludeId.length>0){dbQuery.andWhere('category.id NOT IN (:...excludeId)',{excludeId: query.excludeId});}if(query.excludeName&&query.excludeName.length>0){dbQuery.andWhere('category.name NOT IN (:...excludeName)',{excludeName: query.excludeName},);}if(query.parentId&&query.parentId.length>0){dbQuery.andWhere('parent.id IN (:...parentId)',{parentId: query.parentId});}if(query.parentName&&query.parentName.length>0){dbQuery.andWhere('parent.name IN (:...parentName)',{parentName: query.parentName});}if(query.excludeParentId&&query.excludeParentId.length>0){consttagQuery=this.categoryMapRepository.createQueryBuilder('tag');tagQuery.select('tag.categoryId');tagQuery.where('tag.parentCategoryId IN (:...excludeParentId)',{excludeParentId: query.excludeParentId},);const[tagQueryString,queryParams]=tagQuery.getQueryAndParameters();dbQuery.andWhere(`category.id NOT IN (${tagQueryString})`,queryParams);}if(query.excludeParentOfId&&){}if(query.search){const{ searchKey =['name','label','description']}=query;dbQuery.andWhere(newBrackets((qb)=>{searchKey.forEach((key)=>{qb.orWhere(`category.${key} ILIKE :search`,{search: `%${query.search}%`});});}),);}if(query.$order){constorderKeyList=query.$order.split(',');constsortList=query.$sort ? query.$sort.split(',') : [];orderKeyList.forEach((key,index)=>{dbQuery.addOrderBy(key,<'ASC'|'DESC'>sortList[index]||'ASC');});}else{dbQuery.orderBy('category.name','ASC');}dbQuery.skip(skip);dbQuery.take(limit);const[data,count]=awaitdbQuery.getManyAndCount();return[data,count,Math.ceil(count/limit)];}catch(error){if(!error.code){throwERR_INTERNAL_SERVER(`Search entity category error: ${error.message}`);}throwerror;}}}
When I select copilot completion at this line it would cause segmentation fault
When I select copilot completion at this line instead it doesn't cause segmentation fault
Make sure you have done the following
blink.cmp
<C-k>
on https://cmp.saghen.dev)Bug Description
I'm trying to use copilot with blink using blink-cmp-copilot and copilot.lua but I got segmentation fault when accepting specific completion
the file I use that consistently result segmentation fault is this one
When I select copilot completion at this line it would cause segmentation fault
When I select copilot completion at this line instead it doesn't cause segmentation fault

Relevant configuration
neovim
version0.10.2
blink.cmp
version1.3.1
The text was updated successfully, but these errors were encountered: